@@ -16091,7 +16091,9 @@ mod tests {
16091
16091
16092
16092
#[test]
16093
16093
fn test_inbound_anchors_manual_acceptance() {
16094
- test_inbound_anchors_manual_acceptance_with_override(None);
16094
+ let mut anchors_cfg = test_default_channel_config();
16095
+ anchors_cfg.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
16096
+ do_test_manual_inbound_accept_with_override(anchors_cfg, None);
16095
16097
}
16096
16098
16097
16099
#[test]
@@ -16108,7 +16110,10 @@ mod tests {
16108
16110
update_overrides: None,
16109
16111
};
16110
16112
16111
- let accept_message = test_inbound_anchors_manual_acceptance_with_override(Some(overrides));
16113
+ let mut anchors_cfg = test_default_channel_config();
16114
+ anchors_cfg.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
16115
+
16116
+ let accept_message = do_test_manual_inbound_accept_with_override(anchors_cfg, Some(overrides));
16112
16117
assert_eq!(accept_message.common_fields.max_htlc_value_in_flight_msat, 5_000_000);
16113
16118
assert_eq!(accept_message.common_fields.htlc_minimum_msat, 1_000);
16114
16119
assert_eq!(accept_message.common_fields.minimum_depth, 2);
@@ -16117,19 +16122,16 @@ mod tests {
16117
16122
assert_eq!(accept_message.channel_reserve_satoshis, 2_000);
16118
16123
}
16119
16124
16120
- fn test_inbound_anchors_manual_acceptance_with_override(config_overrides: Option<ChannelConfigOverrides>) -> AcceptChannel {
16121
- // Tests that we properly limit inbound channels when we have the manual-channel-acceptance
16122
- // flag set and (sometimes) accept channels as 0conf.
16123
- let mut anchors_cfg = test_default_channel_config();
16124
- anchors_cfg.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
16125
+ fn do_test_manual_inbound_accept_with_override(start_cfg: UserConfig,
16126
+ config_overrides: Option<ChannelConfigOverrides>) -> AcceptChannel {
16125
16127
16126
- let mut anchors_manual_accept_cfg = anchors_cfg .clone();
16127
- anchors_manual_accept_cfg .manually_accept_inbound_channels = true;
16128
+ let mut mannual_accept_cfg = start_cfg .clone();
16129
+ mannual_accept_cfg .manually_accept_inbound_channels = true;
16128
16130
16129
16131
let chanmon_cfgs = create_chanmon_cfgs(3);
16130
16132
let node_cfgs = create_node_cfgs(3, &chanmon_cfgs);
16131
16133
let node_chanmgrs = create_node_chanmgrs(3, &node_cfgs,
16132
- &[Some(anchors_cfg .clone()), Some(anchors_cfg .clone()), Some(anchors_manual_accept_cfg .clone())]);
16134
+ &[Some(start_cfg .clone()), Some(start_cfg .clone()), Some(mannual_accept_cfg .clone())]);
16133
16135
let nodes = create_network(3, &node_cfgs, &node_chanmgrs);
16134
16136
16135
16137
nodes[0].node.create_channel(nodes[1].node.get_our_node_id(), 100_000, 0, 42, None, None).unwrap();
0 commit comments