Skip to content

Commit caf0aac

Browse files
Merge pull request #4407 from elnosh/4354-followup
4354 follow up
2 parents 4b1cbf7 + 4e32d10 commit caf0aac

5 files changed

Lines changed: 14 additions & 33 deletions

File tree

lightning/src/ln/async_signer_tests.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ fn do_test_open_channel(zero_conf: bool) {
7070

7171
// Handle an inbound channel simulating an async signer.
7272
nodes[1].disable_next_channel_signer_op(SignerOp::GetPerCommitmentPoint);
73-
nodes[1].node.handle_open_channel(node_a_id, &open_chan_msg);
7473

7574
if zero_conf {
75+
nodes[1].node.handle_open_channel(node_a_id, &open_chan_msg);
7676
let events = nodes[1].node.get_and_clear_pending_events();
7777
assert_eq!(events.len(), 1, "Expected one event, got {}", events.len());
7878
match &events[0] {
@@ -90,15 +90,7 @@ fn do_test_open_channel(zero_conf: bool) {
9090
ev => panic!("Expected OpenChannelRequest, not {:?}", ev),
9191
}
9292
} else {
93-
let events = nodes[1].node.get_and_clear_pending_events();
94-
assert_eq!(events.len(), 1, "Expected one event, got {}", events.len());
95-
match &events[0] {
96-
Event::OpenChannelRequest { temporary_channel_id, .. } => nodes[1]
97-
.node
98-
.accept_inbound_channel(temporary_channel_id, &node_a_id, 0, None)
99-
.unwrap(),
100-
ev => panic!("Expected OpenChannelRequest, not {:?}", ev),
101-
}
93+
handle_and_accept_open_channel(&nodes[1], node_a_id, &open_chan_msg);
10294
}
10395

10496
let channel_id_1 = {
@@ -372,11 +364,9 @@ fn test_funding_signed_0conf() {
372364

373365
fn do_test_funding_signed_0conf(signer_ops: Vec<SignerOp>) {
374366
// Simulate acquiring the signature for `funding_signed` asynchronously for a zero-conf channel.
375-
let mut manually_accept_config = test_default_channel_config();
376-
377367
let chanmon_cfgs = create_chanmon_cfgs(2);
378368
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
379-
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, Some(manually_accept_config)]);
369+
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
380370
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
381371
let node_a_id = nodes[0].node.get_our_node_id();
382372
let node_b_id = nodes[1].node.get_our_node_id();

lightning/src/ln/priv_short_conf_tests.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,9 +1396,7 @@ fn test_connect_before_funding() {
13961396
let chanmon_cfgs = create_chanmon_cfgs(2);
13971397
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
13981398

1399-
let mut manually_accept_conf = test_default_channel_config();
1400-
1401-
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, Some(manually_accept_conf)]);
1399+
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
14021400
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
14031401
let node_a_id = nodes[0].node.get_our_node_id();
14041402
let node_b_id = nodes[1].node.get_our_node_id();

lightning/src/ln/reorg_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ fn test_htlc_preimage_claim_holder_commitment_after_counterparty_commitment_reor
686686
let chanmon_cfgs = create_chanmon_cfgs(2);
687687
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
688688
let legacy_cfg = test_legacy_channel_config();
689-
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[Some(legacy_cfg), None, None]);
689+
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[Some(legacy_cfg), None]);
690690
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
691691

692692
let (_, _, chan_id, funding_tx) = create_announced_chan_between_nodes(&nodes, 0, 1);
@@ -762,7 +762,7 @@ fn test_htlc_preimage_claim_prev_counterparty_commitment_after_current_counterpa
762762
let chanmon_cfgs = create_chanmon_cfgs(2);
763763
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
764764
let legacy_cfg = test_legacy_channel_config();
765-
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[Some(legacy_cfg), None, None]);
765+
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[Some(legacy_cfg), None]);
766766
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
767767

768768
let (_, _, chan_id, funding_tx) = create_announced_chan_between_nodes(&nodes, 0, 1);

lightning/src/ln/splicing_tests.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,8 +1081,7 @@ fn do_test_splice_commitment_broadcast(splice_status: SpliceStatus, claim_htlcs:
10811081
// Tests that we're able to enforce HTLCs onchain during the different stages of a splice.
10821082
let chanmon_cfgs = create_chanmon_cfgs(2);
10831083
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
1084-
let config = test_default_channel_config();
1085-
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[Some(config.clone()), Some(config)]);
1084+
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
10861085
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
10871086

10881087
let node_id_0 = nodes[0].node.get_our_node_id();
@@ -1833,8 +1832,7 @@ fn do_test_propose_splice_while_disconnected(reload: bool, use_0conf: bool) {
18331832
fn disconnect_on_unexpected_interactive_tx_message() {
18341833
let chanmon_cfgs = create_chanmon_cfgs(2);
18351834
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
1836-
let config = test_default_channel_config();
1837-
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[Some(config.clone()), Some(config)]);
1835+
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
18381836
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
18391837

18401838
let initiator = &nodes[0];
@@ -1872,8 +1870,7 @@ fn disconnect_on_unexpected_interactive_tx_message() {
18721870
fn fail_splice_on_interactive_tx_error() {
18731871
let chanmon_cfgs = create_chanmon_cfgs(2);
18741872
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
1875-
let config = test_default_channel_config();
1876-
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[Some(config.clone()), Some(config)]);
1873+
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
18771874
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
18781875

18791876
let initiator = &nodes[0];
@@ -1926,8 +1923,7 @@ fn fail_splice_on_interactive_tx_error() {
19261923
fn fail_splice_on_tx_abort() {
19271924
let chanmon_cfgs = create_chanmon_cfgs(2);
19281925
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
1929-
let config = test_default_channel_config();
1930-
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[Some(config.clone()), Some(config)]);
1926+
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
19311927
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
19321928

19331929
let initiator = &nodes[0];
@@ -1980,8 +1976,7 @@ fn fail_splice_on_tx_abort() {
19801976
fn fail_splice_on_channel_close() {
19811977
let chanmon_cfgs = create_chanmon_cfgs(2);
19821978
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
1983-
let config = test_default_channel_config();
1984-
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[Some(config.clone()), Some(config)]);
1979+
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
19851980
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
19861981

19871982
let initiator = &nodes[0];
@@ -2031,8 +2026,7 @@ fn fail_splice_on_channel_close() {
20312026
fn fail_quiescent_action_on_channel_close() {
20322027
let chanmon_cfgs = create_chanmon_cfgs(2);
20332028
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
2034-
let config = test_default_channel_config();
2035-
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[Some(config.clone()), Some(config)]);
2029+
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
20362030
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
20372031

20382032
let initiator = &nodes[0];

pending_changelog/3137-accept-dual-funding-without-contributing.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
differentiate between an inbound request for a dual-funded (V2) or non-dual-funded (V1) channel to be
88
opened, with value being either of the enum variants `InboundChannelFunds::DualFunded` and
99
`InboundChannelFunds::PushMsat(u64)` corresponding to V2 and V1 channel open requests respectively.
10-
* If `manually_accept_inbound_channels` is false, then V2 channels will be accepted automatically; the
11-
same behaviour as V1 channels. Otherwise, `ChannelManager::accept_inbound_channel()` can also be used
12-
to manually accept an inbound V2 channel.
10+
* Similar to V1 channels, `ChannelManager::accept_inbound_channel()` can also be used
11+
to accept an inbound V2 channel.
1312
* 0conf dual-funded channels are not supported.
1413
* RBF of dual-funded channel funding transactions is not supported.
1514

0 commit comments

Comments
 (0)