(node_factory, bitcoind)
| 999 | @pytest.mark.openchannel('v1') |
| 1000 | @pytest.mark.openchannel('v2') |
| 1001 | def test_shutdown_awaiting_lockin(node_factory, bitcoind): |
| 1002 | l1 = node_factory.get_node() |
| 1003 | l2 = node_factory.get_node(options={'funding-confirms': 3}) |
| 1004 | |
| 1005 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 1006 | l1.fundwallet(10**6 + 1000000) |
| 1007 | chanid = l1.rpc.fundchannel(l2.info['id'], 10**6)['channel_id'] |
| 1008 | |
| 1009 | # Technically, this is async to fundchannel. |
| 1010 | bitcoind.generate_block(1, wait_for_mempool=1) |
| 1011 | |
| 1012 | l1.rpc.close(chanid) |
| 1013 | |
| 1014 | l1_state = 'DUALOPEND' if l1.config('experimental-dual-fund') else 'CHANNELD' |
| 1015 | l2_state = 'DUALOPEND' if l1.config('experimental-dual-fund') else 'CHANNELD' |
| 1016 | l1.daemon.wait_for_log('{}_AWAITING_LOCKIN to CHANNELD_SHUTTING_DOWN'.format(l1_state)) |
| 1017 | l2.daemon.wait_for_log('{}_AWAITING_LOCKIN to CHANNELD_SHUTTING_DOWN'.format(l2_state)) |
| 1018 | |
| 1019 | l1.daemon.wait_for_log('CHANNELD_SHUTTING_DOWN to CLOSINGD_SIGEXCHANGE') |
| 1020 | l2.daemon.wait_for_log('CHANNELD_SHUTTING_DOWN to CLOSINGD_SIGEXCHANGE') |
| 1021 | |
| 1022 | # And should put closing into mempool (happens async, so |
| 1023 | # CLOSINGD_COMPLETE may come first). |
| 1024 | l1.daemon.wait_for_logs(['sendrawtx exit 0', ' to CLOSINGD_COMPLETE']) |
| 1025 | l2.daemon.wait_for_logs(['sendrawtx exit 0', ' to CLOSINGD_COMPLETE']) |
| 1026 | |
| 1027 | bitcoind.generate_block(1, wait_for_mempool=1) |
| 1028 | l1.daemon.wait_for_log(' to ONCHAIN') |
| 1029 | l2.daemon.wait_for_log(' to ONCHAIN') |
| 1030 | |
| 1031 | bitcoind.generate_block(100) |
| 1032 | |
| 1033 | # Won't disconnect! |
| 1034 | wait_for(lambda: l1.rpc.listpeerchannels()['channels'] == []) |
| 1035 | wait_for(lambda: l2.rpc.listpeerchannels()['channels'] == []) |
| 1036 | |
| 1037 | |
| 1038 | @pytest.mark.openchannel('v1') |
nothing calls this directly
no test coverage detected