Skip to content

Commit 7d406d9

Browse files
committed
Introduce nonzero fee anchors feature.
1 parent c5214c2 commit 7d406d9

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8732,8 +8732,8 @@ mod tests {
87328732
let simple_anchors_raw_features = static_remote_key_required | simple_anchors_required;
87338733
let simple_anchors_init = InitFeatures::from_le_bytes(simple_anchors_raw_features.to_le_bytes().to_vec());
87348734
let simple_anchors_channel_type = ChannelTypeFeatures::from_le_bytes(simple_anchors_raw_features.to_le_bytes().to_vec());
8735-
assert!(simple_anchors_init.requires_unknown_bits());
8736-
assert!(simple_anchors_channel_type.requires_unknown_bits());
8735+
assert!(!simple_anchors_init.requires_unknown_bits());
8736+
assert!(!simple_anchors_channel_type.requires_unknown_bits());
87378737

87388738
// First, we'll try to open a channel between A and B where A requests a channel type for
87398739
// the original `option_anchors` feature (non zero fee htlc tx). This should be rejected by

lightning/src/ln/features.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ mod sealed {
134134
// Byte 1
135135
VariableLengthOnion | StaticRemoteKey | PaymentSecret,
136136
// Byte 2
137-
BasicMPP | Wumbo | AnchorsZeroFeeHtlcTx,
137+
BasicMPP | Wumbo | AnchorsNonzeroFeeHtlcTx | AnchorsZeroFeeHtlcTx,
138138
// Byte 3
139139
ShutdownAnySegwit,
140140
// Byte 4
@@ -150,7 +150,7 @@ mod sealed {
150150
// Byte 1
151151
VariableLengthOnion | StaticRemoteKey | PaymentSecret,
152152
// Byte 2
153-
BasicMPP | Wumbo | AnchorsZeroFeeHtlcTx,
153+
BasicMPP | Wumbo | AnchorsNonzeroFeeHtlcTx | AnchorsZeroFeeHtlcTx,
154154
// Byte 3
155155
ShutdownAnySegwit,
156156
// Byte 4
@@ -196,7 +196,7 @@ mod sealed {
196196
// Byte 1
197197
StaticRemoteKey,
198198
// Byte 2
199-
AnchorsZeroFeeHtlcTx,
199+
AnchorsNonzeroFeeHtlcTx | AnchorsZeroFeeHtlcTx,
200200
// Byte 3
201201
,
202202
// Byte 4
@@ -378,6 +378,9 @@ mod sealed {
378378
define_feature!(19, Wumbo, [InitContext, NodeContext],
379379
"Feature flags for `option_support_large_channel` (aka wumbo channels).", set_wumbo_optional, set_wumbo_required,
380380
supports_wumbo, requires_wumbo);
381+
define_feature!(21, AnchorsNonzeroFeeHtlcTx, [InitContext, NodeContext, ChannelTypeContext],
382+
"Feature flags for `option_anchors_nonzero_fee_htlc_tx`.", set_anchors_nonzero_fee_htlc_tx_optional,
383+
set_anchors_nonzero_fee_htlc_tx_required, supports_anchors_nonzero_fee_htlc_tx, requires_anchors_nonzero_fee_htlc_tx);
381384
define_feature!(23, AnchorsZeroFeeHtlcTx, [InitContext, NodeContext, ChannelTypeContext],
382385
"Feature flags for `option_anchors_zero_fee_htlc_tx`.", set_anchors_zero_fee_htlc_tx_optional,
383386
set_anchors_zero_fee_htlc_tx_required, supports_anchors_zero_fee_htlc_tx, requires_anchors_zero_fee_htlc_tx);

0 commit comments

Comments
 (0)