Make sure we re-xmit last tx if we restart and channel is AWAITING_UNILATERAL
(node_factory, bitcoind)
| 4165 | |
| 4166 | |
| 4167 | def test_onchain_rexmit_tx(node_factory, bitcoind): |
| 4168 | """Make sure we re-xmit last tx if we restart and channel is AWAITING_UNILATERAL""" |
| 4169 | l1, l2 = node_factory.line_graph(2) |
| 4170 | |
| 4171 | def ignore_sendrawtx(r): |
| 4172 | return {'id': r['id'], 'result': {}} |
| 4173 | |
| 4174 | l1.daemon.rpcproxy.mock_rpc('sendrawtransaction', ignore_sendrawtx) |
| 4175 | |
| 4176 | l2.stop() |
| 4177 | l1.rpc.close(l2.info['id'], unilateraltimeout=1) |
| 4178 | |
| 4179 | peer = only_one(l1.rpc.listpeers()["peers"]) |
| 4180 | wait_for(lambda: only_one(l1.rpc.listpeerchannels(peer["id"])['channels'])['state'] == 'AWAITING_UNILATERAL') |
| 4181 | l1.stop() |
| 4182 | |
| 4183 | assert bitcoind.rpc.getrawmempool() == [] |
| 4184 | l1.daemon.rpcproxy.mock_rpc('sendrawtransaction', None) |
| 4185 | |
| 4186 | l1.start() |
| 4187 | wait_for(lambda: len(bitcoind.rpc.getrawmempool()) == 1) |
| 4188 | |
| 4189 | |
| 4190 | @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd anchors unsupported') |
nothing calls this directly
no test coverage detected