]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Tweak `test_unconf_chan` to test that we don't prematurely close 2022-05-unconf-0-not-half
authorMatt Corallo <git@bluematt.me>
Mon, 2 May 2022 15:07:20 +0000 (15:07 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 3 May 2022 17:26:36 +0000 (17:26 +0000)
lightning/src/ln/reorg_tests.rs

index 2f97864b10ec7c5a0fa7cf961547ff517406d11d..96fda526d68d2d46369b9c9ec831d96551e86112 100644 (file)
@@ -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]);
                }