MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_shutdown_reconnect

Function test_shutdown_reconnect

tests/test_connection.py:929–955  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

927@pytest.mark.openchannel('v1')
928@pytest.mark.openchannel('v2')
929def test_shutdown_reconnect(node_factory):
930 disconnects = ['-WIRE_SHUTDOWN',
931 '+WIRE_SHUTDOWN']
932 l1 = node_factory.get_node(disconnect=disconnects,
933 may_reconnect=True)
934 l2 = node_factory.get_node(may_reconnect=True)
935 l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
936
937 chan, _ = l1.fundchannel(l2, 10**6)
938 l1.pay(l2, 200000000)
939
940 assert l1.bitcoin.rpc.getmempoolinfo()['size'] == 0
941
942 # This should wait until we're closed.
943 l1.rpc.close(chan)
944
945 l1.daemon.wait_for_log(' to CHANNELD_SHUTTING_DOWN')
946 l2.daemon.wait_for_log(' to CHANNELD_SHUTTING_DOWN')
947
948 l1.daemon.wait_for_log(' to CLOSINGD_SIGEXCHANGE')
949 l2.daemon.wait_for_log(' to CLOSINGD_SIGEXCHANGE')
950
951 # And should put closing into mempool (happens async, so
952 # CLOSINGD_COMPLETE may come first).
953 l1.daemon.wait_for_logs(['sendrawtx exit 0', ' to CLOSINGD_COMPLETE'])
954 l2.daemon.wait_for_logs(['sendrawtx exit 0', ' to CLOSINGD_COMPLETE'])
955 assert l1.bitcoin.rpc.getmempoolinfo()['size'] == 1
956
957
958@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "sqlite3-specific DB manip")

Callers

nothing calls this directly

Calls 7

wait_for_logMethod · 0.80
wait_for_logsMethod · 0.80
get_nodeMethod · 0.45
connectMethod · 0.45
fundchannelMethod · 0.45
payMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected