We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c4a2f1b + 53fc986 commit 36e434dCopy full SHA for 36e434d
lightning-invoice/src/lib.rs
@@ -1348,6 +1348,15 @@ impl Bolt11Invoice {
1348
self.signed_invoice.recover_payee_pub_key().expect("was checked by constructor").0
1349
}
1350
1351
+ /// Recover the payee's public key if one was included in the invoice, otherwise return the
1352
+ /// recovered public key from the signature
1353
+ pub fn get_payee_pub_key(&self) -> PublicKey {
1354
+ match self.payee_pub_key() {
1355
+ Some(pk) => *pk,
1356
+ None => self.recover_payee_pub_key()
1357
+ }
1358
1359
+
1360
/// Returns the Duration since the Unix epoch at which the invoice expires.
1361
/// Returning None if overflow occurred.
1362
pub fn expires_at(&self) -> Option<Duration> {
0 commit comments