(node_factory, bitcoind)
| 103 | # Test that the max-channel-id is set correctly between |
| 104 | # restarts (with forgotten channel) |
| 105 | def test_max_channel_id(node_factory, bitcoind): |
| 106 | # Create a channel between two peers. |
| 107 | # Close the channel and have 100 blocks happen (forget channel) |
| 108 | # Restart node, create channel again. Should succeed. |
| 109 | l1, l2 = node_factory.line_graph(2, fundchannel=True, wait_for_announce=True) |
| 110 | sync_blockheight(bitcoind, [l1, l2]) |
| 111 | |
| 112 | # Now shutdown cleanly. |
| 113 | l1.rpc.close(l2.info['id'], 0) |
| 114 | |
| 115 | l1.daemon.wait_for_log(' to CLOSINGD_COMPLETE') |
| 116 | l2.daemon.wait_for_log(' to CLOSINGD_COMPLETE') |
| 117 | |
| 118 | # And should put closing into mempool. |
| 119 | l1.wait_for_channel_onchain(l2.info['id']) |
| 120 | l2.wait_for_channel_onchain(l1.info['id']) |
| 121 | |
| 122 | bitcoind.generate_block(101) |
| 123 | wait_for(lambda: l1.rpc.listpeerchannels()['channels'] == []) |
| 124 | wait_for(lambda: l2.rpc.listpeerchannels()['channels'] == []) |
| 125 | |
| 126 | # Stop l2, and restart |
| 127 | l2.stop() |
| 128 | l2.start() |
| 129 | |
| 130 | # Reconnect |
| 131 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 132 | |
| 133 | # Fundchannel again, should succeed. |
| 134 | l1.rpc.fundchannel(l2.info['id'], 10**5) |
| 135 | |
| 136 | |
| 137 | @unittest.skipIf(not COMPAT, "needs COMPAT to convert obsolete db") |
nothing calls this directly
no test coverage detected