Skip to content

Commit 7da955f

Browse files
committed
Define BOLT 12 invoice features with MPP support
1 parent 005566a commit 7da955f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lightning/src/ln/features.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ mod sealed {
159159
]);
160160
define_context!(OfferContext, []);
161161
define_context!(InvoiceRequestContext, []);
162+
define_context!(Bolt12InvoiceContext, [
163+
// Byte 0
164+
,
165+
// Byte 1
166+
,
167+
// Byte 2
168+
BasicMPP,
169+
]);
162170
// This isn't a "real" feature context, and is only used in the channel_type field in an
163171
// `OpenChannel` message.
164172
define_context!(ChannelTypeContext, [
@@ -342,7 +350,7 @@ mod sealed {
342350
define_feature!(15, PaymentSecret, [InitContext, NodeContext, InvoiceContext],
343351
"Feature flags for `payment_secret`.", set_payment_secret_optional, set_payment_secret_required,
344352
supports_payment_secret, requires_payment_secret);
345-
define_feature!(17, BasicMPP, [InitContext, NodeContext, InvoiceContext],
353+
define_feature!(17, BasicMPP, [InitContext, NodeContext, InvoiceContext, Bolt12InvoiceContext],
346354
"Feature flags for `basic_mpp`.", set_basic_mpp_optional, set_basic_mpp_required,
347355
supports_basic_mpp, requires_basic_mpp);
348356
define_feature!(19, Wumbo, [InitContext, NodeContext],
@@ -369,7 +377,7 @@ mod sealed {
369377

370378
#[cfg(test)]
371379
define_feature!(123456789, UnknownFeature,
372-
[NodeContext, ChannelContext, InvoiceContext, OfferContext, InvoiceRequestContext],
380+
[NodeContext, ChannelContext, InvoiceContext, OfferContext, InvoiceRequestContext, Bolt12InvoiceContext],
373381
"Feature flags for an unknown feature used in testing.", set_unknown_feature_optional,
374382
set_unknown_feature_required, supports_unknown_test_feature, requires_unknown_test_feature);
375383
}
@@ -432,6 +440,8 @@ pub type InvoiceFeatures = Features<sealed::InvoiceContext>;
432440
pub type OfferFeatures = Features<sealed::OfferContext>;
433441
/// Features used within an `invoice_request`.
434442
pub type InvoiceRequestFeatures = Features<sealed::InvoiceRequestContext>;
443+
/// Features used within an `invoice`.
444+
pub type Bolt12InvoiceFeatures = Features<sealed::Bolt12InvoiceContext>;
435445

436446
/// Features used within the channel_type field in an OpenChannel message.
437447
///

0 commit comments

Comments
 (0)