From e66bd25b5cb2f7bc8e69eecaee437dec92df2968 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 25 Jan 2018 21:33:50 +1030 Subject: [PATCH] test_lightningd.py: test lockin while we're not running. Signed-off-by: Rusty Russell --- tests/test_lightningd.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index 5d17a95a0..56ddb20ee 100644 --- a/tests/test_lightningd.py +++ b/tests/test_lightningd.py @@ -2502,6 +2502,27 @@ class LightningDTests(BaseLightningDTests): amount = amount-1 l1.rpc.fundchannel(l2.info['id'], amount) + def test_lockin_between_restart(self): + l1 = self.node_factory.get_node() + l2 = self.node_factory.get_node(options=['--anchor-confirms=3']) + l1.rpc.connect(l2.info['id'], 'localhost', l2.info['port']) + + self.give_funds(l1, 10**6 + 1000000) + l1.rpc.fundchannel(l2.info['id'], 10**6)['tx'] + + # l1 goes down. + l1.stop() + + # Now 120 blocks go by... + bitcoind.generate_block(120) + + # Restart + l1.daemon.start() + + # All should be good. + l1.daemon.wait_for_log('-> CHANNELD_NORMAL') + l2.daemon.wait_for_log('-> CHANNELD_NORMAL') + def test_addfunds_from_block(self): """Send funds to the daemon without telling it explicitly """