@@ -16288,7 +16288,9 @@ mod tests {
16288
16288
16289
16289
#[test]
16290
16290
fn test_inbound_anchors_manual_acceptance() {
16291
- test_inbound_anchors_manual_acceptance_with_override(None);
16291
+ let mut anchors_cfg = test_default_channel_config();
16292
+ anchors_cfg.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
16293
+ do_test_manual_inbound_accept_with_override(anchors_cfg, None);
16292
16294
}
16293
16295
16294
16296
#[test]
@@ -16305,7 +16307,11 @@ mod tests {
16305
16307
update_overrides: None,
16306
16308
};
16307
16309
16308
- let accept_message = test_inbound_anchors_manual_acceptance_with_override(Some(overrides));
16310
+ let mut anchors_cfg = test_default_channel_config();
16311
+ anchors_cfg.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
16312
+
16313
+ let accept_message =
16314
+ do_test_manual_inbound_accept_with_override(anchors_cfg, Some(overrides));
16309
16315
assert_eq!(accept_message.common_fields.max_htlc_value_in_flight_msat, 5_000_000);
16310
16316
assert_eq!(accept_message.common_fields.htlc_minimum_msat, 1_000);
16311
16317
assert_eq!(accept_message.common_fields.minimum_depth, 2);
@@ -16315,19 +16321,16 @@ mod tests {
16315
16321
}
16316
16322
16317
16323
#[rustfmt::skip]
16318
- fn test_inbound_anchors_manual_acceptance_with_override(config_overrides: Option<ChannelConfigOverrides>) -> AcceptChannel {
16319
- // Tests that we properly limit inbound channels when we have the manual-channel-acceptance
16320
- // flag set and (sometimes) accept channels as 0conf.
16321
- let mut anchors_cfg = test_default_channel_config();
16322
- anchors_cfg.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
16324
+ fn do_test_manual_inbound_accept_with_override(start_cfg: UserConfig,
16325
+ config_overrides: Option<ChannelConfigOverrides>) -> AcceptChannel {
16323
16326
16324
- let mut anchors_manual_accept_cfg = anchors_cfg .clone();
16325
- anchors_manual_accept_cfg .manually_accept_inbound_channels = true;
16327
+ let mut mannual_accept_cfg = start_cfg .clone();
16328
+ mannual_accept_cfg .manually_accept_inbound_channels = true;
16326
16329
16327
16330
let chanmon_cfgs = create_chanmon_cfgs(3);
16328
16331
let node_cfgs = create_node_cfgs(3, &chanmon_cfgs);
16329
16332
let node_chanmgrs = create_node_chanmgrs(3, &node_cfgs,
16330
- &[Some(anchors_cfg .clone()), Some(anchors_cfg .clone()), Some(anchors_manual_accept_cfg .clone())]);
16333
+ &[Some(start_cfg .clone()), Some(start_cfg .clone()), Some(mannual_accept_cfg .clone())]);
16331
16334
let nodes = create_network(3, &node_cfgs, &node_chanmgrs);
16332
16335
16333
16336
nodes[0].node.create_channel(nodes[1].node.get_our_node_id(), 100_000, 0, 42, None, None).unwrap();
0 commit comments