Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lightning-invoice/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,15 @@ impl Bolt11Invoice {
self.signed_invoice.recover_payee_pub_key().expect("was checked by constructor").0
}

/// Recover the payee's public key if one was included in the invoice, otherwise return the
/// recovered public key from the signature
pub fn get_payee_pub_key(&self) -> PublicKey {
match self.payee_pub_key() {
Some(pk) => *pk,
None => self.recover_payee_pub_key()
}
}

/// Returns the Duration since the Unix epoch at which the invoice expires.
/// Returning None if overflow occurred.
pub fn expires_at(&self) -> Option<Duration> {
Expand Down