(node_factory, bitcoind)
| 938 | @pytest.mark.openchannel('v1') |
| 939 | @pytest.mark.openchannel('v2') |
| 940 | def test_shutdown_awaiting_lockin(node_factory, bitcoind): |
| 941 | l1 = node_factory.get_node() |
| 942 | l2 = node_factory.get_node(options={'funding-confirms': 3}) |
| 943 | |
| 944 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 945 | l1.fundwallet(10**6 + 1000000) |
| 946 | chanid = l1.rpc.fundchannel(l2.info['id'], 10**6)['channel_id'] |
| 947 | |
| 948 | # Technically, this is async to fundchannel. |
| 949 | bitcoind.generate_block(1, wait_for_mempool=1) |
| 950 | |
| 951 | l1.rpc.close(chanid) |
| 952 | |
| 953 | l1_state = 'DUALOPEND' if l1.config('experimental-dual-fund') else 'CHANNELD' |
| 954 | l2_state = 'DUALOPEND' if l1.config('experimental-dual-fund') else 'CHANNELD' |
| 955 | l1.daemon.wait_for_log('{}_AWAITING_LOCKIN to CHANNELD_SHUTTING_DOWN'.format(l1_state)) |
| 956 | l2.daemon.wait_for_log('{}_AWAITING_LOCKIN to CHANNELD_SHUTTING_DOWN'.format(l2_state)) |
| 957 | |
| 958 | l1.daemon.wait_for_log('CHANNELD_SHUTTING_DOWN to CLOSINGD_SIGEXCHANGE') |
| 959 | l2.daemon.wait_for_log('CHANNELD_SHUTTING_DOWN to CLOSINGD_SIGEXCHANGE') |
| 960 | |
| 961 | # And should put closing into mempool (happens async, so |
| 962 | # CLOSINGD_COMPLETE may come first). |
| 963 | l1.daemon.wait_for_logs(['sendrawtx exit 0', ' to CLOSINGD_COMPLETE']) |
| 964 | l2.daemon.wait_for_logs(['sendrawtx exit 0', ' to CLOSINGD_COMPLETE']) |
| 965 | |
| 966 | bitcoind.generate_block(1, wait_for_mempool=1) |
| 967 | l1.daemon.wait_for_log(' to ONCHAIN') |
| 968 | l2.daemon.wait_for_log(' to ONCHAIN') |
| 969 | |
| 970 | bitcoind.generate_block(100) |
| 971 | |
| 972 | # Won't disconnect! |
| 973 | wait_for(lambda: only_one(l1.rpc.listpeers()['peers'])['channels'] == []) |
| 974 | wait_for(lambda: only_one(l2.rpc.listpeers()['peers'])['channels'] == []) |
| 975 | |
| 976 | |
| 977 | @pytest.mark.openchannel('v1') |
nothing calls this directly
no test coverage detected