X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-invoice%2Fsrc%2Flib.rs;h=5b326911444cece5a8b032732f9da24985b2ca25;hb=8354e0c9ba383d4f4df14c9735847a0b19a37f91;hp=df0412bfc5d3e0d3876b177200527e01fd272678;hpb=3fbee852b3b5fe839f2fccb1e343bc0bbe8e570d;p=rust-lightning diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index df0412bf..5b326911 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -79,14 +79,7 @@ mod tb; #[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; } @@ -550,7 +543,7 @@ impl InvoiceBuilder 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 {