Store channels per peer
[rust-lightning] / lightning / src / ln / features.rs
index 9d34433161a55e064afcddca798fa6fe7aaacdeb..a3c1b7f623d1f2a355516638e75432e61a04fa71 100644 (file)
@@ -159,6 +159,15 @@ mod sealed {
        ]);
        define_context!(OfferContext, []);
        define_context!(InvoiceRequestContext, []);
+       define_context!(Bolt12InvoiceContext, [
+               // Byte 0
+               ,
+               // Byte 1
+               ,
+               // Byte 2
+               BasicMPP,
+       ]);
+       define_context!(BlindedHopContext, []);
        // This isn't a "real" feature context, and is only used in the channel_type field in an
        // `OpenChannel` message.
        define_context!(ChannelTypeContext, [
@@ -342,7 +351,7 @@ mod sealed {
        define_feature!(15, PaymentSecret, [InitContext, NodeContext, InvoiceContext],
                "Feature flags for `payment_secret`.", set_payment_secret_optional, set_payment_secret_required,
                supports_payment_secret, requires_payment_secret);
-       define_feature!(17, BasicMPP, [InitContext, NodeContext, InvoiceContext],
+       define_feature!(17, BasicMPP, [InitContext, NodeContext, InvoiceContext, Bolt12InvoiceContext],
                "Feature flags for `basic_mpp`.", set_basic_mpp_optional, set_basic_mpp_required,
                supports_basic_mpp, requires_basic_mpp);
        define_feature!(19, Wumbo, [InitContext, NodeContext],
@@ -369,7 +378,7 @@ mod sealed {
 
        #[cfg(test)]
        define_feature!(123456789, UnknownFeature,
-               [NodeContext, ChannelContext, InvoiceContext, OfferContext, InvoiceRequestContext],
+               [NodeContext, ChannelContext, InvoiceContext, OfferContext, InvoiceRequestContext, Bolt12InvoiceContext, BlindedHopContext],
                "Feature flags for an unknown feature used in testing.", set_unknown_feature_optional,
                set_unknown_feature_required, supports_unknown_test_feature, requires_unknown_test_feature);
 }
@@ -432,6 +441,10 @@ pub type InvoiceFeatures = Features<sealed::InvoiceContext>;
 pub type OfferFeatures = Features<sealed::OfferContext>;
 /// Features used within an `invoice_request`.
 pub type InvoiceRequestFeatures = Features<sealed::InvoiceRequestContext>;
+/// Features used within an `invoice`.
+pub type Bolt12InvoiceFeatures = Features<sealed::Bolt12InvoiceContext>;
+/// Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
+pub type BlindedHopFeatures = Features<sealed::BlindedHopContext>;
 
 /// Features used within the channel_type field in an OpenChannel message.
 ///
@@ -719,6 +732,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!(BlindedHopFeatures);
 
 // Some features only appear inside of TLVs, so they don't have a length prefix when serialized.
 macro_rules! impl_feature_tlv_write {