From: Matt Corallo Date: Mon, 2 May 2022 15:07:20 +0000 (+0000) Subject: Tweak `test_unconf_chan` to test that we don't prematurely close X-Git-Tag: v0.0.107~43^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=1568097696e6aa09eaf7425dab0f68b12fa28c3f;p=rust-lightning Tweak `test_unconf_chan` to test that we don't prematurely close --- 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]); }