#[allow(unused_imports)]
mod prelude {
- #[cfg(feature = "hashbrown")]
- extern crate hashbrown;
-
pub use alloc::{vec, vec::Vec, string::String};
- #[cfg(not(feature = "hashbrown"))]
- pub use std::collections::{HashMap, hash_map};
- #[cfg(feature = "hashbrown")]
- pub use self::hashbrown::{HashMap, HashSet, hash_map};
pub use alloc::string::ToString;
}
amount: None,
si_prefix: None,
timestamp: None,
- tagged_fields: Vec::new(),
+ tagged_fields: Vec::with_capacity(8),
error: None,
phantom_d: core::marker::PhantomData,
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> {