Skip to content

Commit 6fe04ad

Browse files
committed
f Add test coverage for skipping anchors when not negotiated
1 parent bd5facf commit 6fe04ad

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16227,6 +16227,23 @@ mod tests {
1622716227
do_test_channel_type_downgrade(initiator_cfg, receiver_cfg, start_type, downgrade_types);
1622816228
}
1622916229

16230+
#[test]
16231+
fn test_zero_fee_commitments_downgrade_to_static_remote() {
16232+
// Tests that the local node will retry with static remote key when zero fee commitments
16233+
// are supported (but not accepted), but not legacy anchors.
16234+
let mut initiator_cfg = test_default_channel_config();
16235+
initiator_cfg .channel_handshake_config.negotiate_anchor_zero_fee_commitments = true;
16236+
initiator_cfg .channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
16237+
16238+
let mut receiver_cfg = test_default_channel_config();
16239+
receiver_cfg.channel_handshake_config.negotiate_anchor_zero_fee_commitments = true;
16240+
receiver_cfg.manually_accept_inbound_channels = true;
16241+
16242+
let start_type = ChannelTypeFeatures::anchors_zero_fee_commitments();
16243+
let end_type = ChannelTypeFeatures::only_static_remote_key();
16244+
do_test_channel_type_downgrade(initiator_cfg, receiver_cfg, start_type, vec![end_type]);
16245+
}
16246+
1623016247
fn do_test_channel_type_downgrade(initiator_cfg: UserConfig, acceptor_cfg: UserConfig,
1623116248
start_type: ChannelTypeFeatures, downgrade_types: Vec<ChannelTypeFeatures>) {
1623216249
let chanmon_cfgs = create_chanmon_cfgs(2);

0 commit comments

Comments
 (0)