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

Function test_closing_while_disconnected

tests/test_closing.py:134–157  ·  view source on GitHub ↗
(node_factory, bitcoind, executor)

Source from the content-addressed store, hash-verified

132
133
134def test_closing_while_disconnected(node_factory, bitcoind, executor):
135 l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True})
136 chan = l1.get_channel_scid(l2)
137
138 l1.pay(l2, 200000000)
139 l2.stop()
140
141 # The close should still be triggered afterwards.
142 fut = executor.submit(l1.rpc.close, chan, 0)
143 l1.daemon.wait_for_log(' to CHANNELD_SHUTTING_DOWN')
144
145 l2.start()
146 fut.result(TIMEOUT)
147
148 l1.daemon.wait_for_log(' to CLOSINGD_SIGEXCHANGE')
149 l2.daemon.wait_for_log(' to CLOSINGD_SIGEXCHANGE')
150
151 # And should put closing into mempool.
152 l1.daemon.wait_for_log('sendrawtx exit 0')
153 l2.daemon.wait_for_log('sendrawtx exit 0')
154
155 bitcoind.generate_block(101)
156 wait_for(lambda: len(l1.rpc.listchannels()['channels']) == 0)
157 wait_for(lambda: len(l2.rpc.listchannels()['channels']) == 0)
158
159
160def test_closing_disconnected_notify(node_factory, bitcoind, executor):

Callers

nothing calls this directly

Calls 9

wait_forFunction · 0.90
line_graphMethod · 0.80
get_channel_scidMethod · 0.80
wait_for_logMethod · 0.80
generate_blockMethod · 0.80
payMethod · 0.45
stopMethod · 0.45
startMethod · 0.45
listchannelsMethod · 0.45

Tested by

no test coverage detected