(node_factory)
| 927 | @pytest.mark.openchannel('v1') |
| 928 | @pytest.mark.openchannel('v2') |
| 929 | def 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") |
nothing calls this directly
no test coverage detected