X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Ffeatures.rs;h=ca8150b09cfa580d69e55550cc6661b3068ea15c;hb=21b0818be7c3f4b3fce24c2bd3ac0c156549f8bc;hp=8ccbf4166bbe71294a64309ed4832b9364845fa9;hpb=ec3de62bc754ea6cf512488415b6e787e58e7337;p=rust-lightning diff --git a/lightning/src/ln/features.rs b/lightning/src/ln/features.rs index 8ccbf416..ca8150b0 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.