From 1568097696e6aa09eaf7425dab0f68b12fa28c3f Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 2 May 2022 15:07:20 +0000 Subject: [PATCH] Tweak `test_unconf_chan` to test that we don't prematurely close --- lightning/src/ln/reorg_tests.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lightning/src/ln/reorg_tests.rs b/lightning/src/ln/reorg_tests.rs index 2f97864b1..96fda526d 100644 --- a/lightning/src/ln/reorg_tests.rs +++ b/lightning/src/ln/reorg_tests.rs @@ -209,6 +209,10 @@ fn do_test_unconf_chan(reload_node: bool, reorg_after_reload: bool, use_funding_ let relevant_txids = nodes[0].node.get_relevant_txids(); assert_eq!(&relevant_txids[..], &[chan.3.txid()]); nodes[0].node.transaction_unconfirmed(&relevant_txids[0]); + } else if connect_style == ConnectStyle::FullBlockViaListen { + disconnect_blocks(&nodes[0], CHAN_CONFIRM_DEPTH - 1); + assert_eq!(nodes[0].node.list_usable_channels().len(), 1); + disconnect_blocks(&nodes[0], 1); } else { disconnect_all_blocks(&nodes[0]); } @@ -273,6 +277,10 @@ fn do_test_unconf_chan(reload_node: bool, reorg_after_reload: bool, use_funding_ let relevant_txids = nodes[0].node.get_relevant_txids(); assert_eq!(&relevant_txids[..], &[chan.3.txid()]); nodes[0].node.transaction_unconfirmed(&relevant_txids[0]); + } else if connect_style == ConnectStyle::FullBlockViaListen { + disconnect_blocks(&nodes[0], CHAN_CONFIRM_DEPTH - 1); + assert_eq!(nodes[0].node.list_channels().len(), 1); + disconnect_blocks(&nodes[0], 1); } else { disconnect_all_blocks(&nodes[0]); } -- 2.39.5