Skip to content

Commit 31a5962

Browse files
committed
Define option_anchors_zero_fee_htlc_tx feature bit
1 parent bb617d3 commit 31a5962

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

lightning/src/ln/features.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
//! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
5353
//! - `Keysend` - send funds to a node without an invoice
5454
//! (see the [`Keysend` feature assignment proposal](https://github.com/lightning/bolts/issues/605#issuecomment-606679798) for more information).
55+
//! - `AnchorsZeroFeeHtlcTx` - requires/supports that commitment transactions include anchor outputs
56+
//! and HTLC transactions are pre-signed with zero fee (see
57+
//! [BOLT-3](https://github.com/lightning/bolts/blob/master/03-transactions.md) for more
58+
//! information).
5559
//!
5660
//! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
5761
//! [messages]: crate::ln::msgs
@@ -122,7 +126,7 @@ mod sealed {
122126
// Byte 1
123127
VariableLengthOnion | StaticRemoteKey | PaymentSecret,
124128
// Byte 2
125-
BasicMPP | Wumbo,
129+
BasicMPP | Wumbo | AnchorsZeroFeeHtlcTx,
126130
// Byte 3
127131
ShutdownAnySegwit,
128132
// Byte 4
@@ -138,7 +142,7 @@ mod sealed {
138142
// Byte 1
139143
VariableLengthOnion | StaticRemoteKey | PaymentSecret,
140144
// Byte 2
141-
BasicMPP | Wumbo,
145+
BasicMPP | Wumbo | AnchorsZeroFeeHtlcTx,
142146
// Byte 3
143147
ShutdownAnySegwit,
144148
// Byte 4
@@ -176,7 +180,7 @@ mod sealed {
176180
// Byte 1
177181
StaticRemoteKey,
178182
// Byte 2
179-
,
183+
AnchorsZeroFeeHtlcTx,
180184
// Byte 3
181185
,
182186
// Byte 4
@@ -357,6 +361,9 @@ mod sealed {
357361
define_feature!(19, Wumbo, [InitContext, NodeContext],
358362
"Feature flags for `option_support_large_channel` (aka wumbo channels).", set_wumbo_optional, set_wumbo_required,
359363
supports_wumbo, requires_wumbo);
364+
define_feature!(23, AnchorsZeroFeeHtlcTx, [InitContext, NodeContext, ChannelTypeContext],
365+
"Feature flags for `option_anchors_zero_fee_htlc_tx`.", set_anchors_zero_fee_htlc_tx_optional,
366+
set_anchors_zero_fee_htlc_tx_required, supports_anchors_zero_fee_htlc_tx, requires_anchors_zero_fee_htlc_tx);
360367
define_feature!(27, ShutdownAnySegwit, [InitContext, NodeContext],
361368
"Feature flags for `opt_shutdown_anysegwit`.", set_shutdown_any_segwit_optional,
362369
set_shutdown_any_segwit_required, supports_shutdown_anysegwit, requires_shutdown_anysegwit);
@@ -826,7 +833,7 @@ mod tests {
826833
assert_eq!(node_features.flags.len(), 7);
827834
assert_eq!(node_features.flags[0], 0b00000010);
828835
assert_eq!(node_features.flags[1], 0b01010001);
829-
assert_eq!(node_features.flags[2], 0b00001010);
836+
assert_eq!(node_features.flags[2], 0b10001010);
830837
assert_eq!(node_features.flags[3], 0b00001000);
831838
assert_eq!(node_features.flags[4], 0b10000000);
832839
assert_eq!(node_features.flags[5], 0b10100000);

0 commit comments

Comments
 (0)