projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add PaymentPurpose::is_keysend utility method
[rust-lightning]
/
lightning
/
src
/
events
/
mod.rs
diff --git
a/lightning/src/events/mod.rs
b/lightning/src/events/mod.rs
index d6553ae3aa22989f60b6508f7a17a97d990121ed..41ba17806d35b5c5bf31cdb51423775a7d8120cd 100644
(file)
--- a/
lightning/src/events/mod.rs
+++ b/
lightning/src/events/mod.rs
@@
-83,6
+83,13
@@
impl PaymentPurpose {
PaymentPurpose::SpontaneousPayment(preimage) => Some(*preimage),
}
}
PaymentPurpose::SpontaneousPayment(preimage) => Some(*preimage),
}
}
+
+ pub(crate) fn is_keysend(&self) -> bool {
+ match self {
+ PaymentPurpose::Bolt11InvoicePayment { .. } => false,
+ PaymentPurpose::SpontaneousPayment(..) => true,
+ }
+ }
}
impl_writeable_tlv_based_enum!(PaymentPurpose,
}
impl_writeable_tlv_based_enum!(PaymentPurpose,