Add BOLT 12 features to PaymentParams
[rust-lightning] / lightning / src / ln / features.rs
index cf375603b37b5290aaf10250218f4b66cce0678a..3a7d921690429070fe5a0504a6113d740cf66b5e 100644 (file)
@@ -532,6 +532,14 @@ impl InvoiceFeatures {
        }
 }
 
+impl Bolt12InvoiceFeatures {
+       /// Converts `Bolt12InvoiceFeatures` to `Features<C>`. Only known `Bolt12InvoiceFeatures` relevant
+       /// to context `C` are included in the result.
+       pub(crate) fn to_context<C: sealed::Context>(&self) -> Features<C> {
+               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.