X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Ffeatures.rs;fp=lightning%2Fsrc%2Fln%2Ffeatures.rs;h=3a7d921690429070fe5a0504a6113d740cf66b5e;hb=746f25aed06c19b3a4d4bfb25d15b3b08ed410a0;hp=cf375603b37b5290aaf10250218f4b66cce0678a;hpb=91dc76721b4d6cd7b1ca812d59d70dd4c666ead9;p=rust-lightning diff --git a/lightning/src/ln/features.rs b/lightning/src/ln/features.rs index cf375603..3a7d9216 100644 --- a/lightning/src/ln/features.rs +++ b/lightning/src/ln/features.rs @@ -532,6 +532,14 @@ impl InvoiceFeatures { } } +impl Bolt12InvoiceFeatures { + /// Converts `Bolt12InvoiceFeatures` to `Features`. Only known `Bolt12InvoiceFeatures` relevant + /// to context `C` are included in the result. + pub(crate) fn to_context(&self) -> Features { + self.to_context_internal() + } +} + impl ChannelTypeFeatures { // Maps the relevant `InitFeatures` to `ChannelTypeFeatures`. Any unknown features to // `ChannelTypeFeatures` are not included in the result. @@ -791,6 +799,7 @@ impl_feature_len_prefixed_write!(InitFeatures); impl_feature_len_prefixed_write!(ChannelFeatures); impl_feature_len_prefixed_write!(NodeFeatures); impl_feature_len_prefixed_write!(InvoiceFeatures); +impl_feature_len_prefixed_write!(Bolt12InvoiceFeatures); impl_feature_len_prefixed_write!(BlindedHopFeatures); // Some features only appear inside of TLVs, so they don't have a length prefix when serialized.