(node_factory, bitcoind, chainparams)
| 989 | @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') |
| 990 | @pytest.mark.openchannel('v2') |
| 991 | def test_rbf_reconnect_ack(node_factory, bitcoind, chainparams): |
| 992 | disconnects = ['-WIRE_TX_ACK_RBF', |
| 993 | '+WIRE_TX_ACK_RBF'] |
| 994 | |
| 995 | l1, l2 = node_factory.get_nodes(2, |
| 996 | opts=[{'may_reconnect': True}, |
| 997 | {'disconnect': disconnects, |
| 998 | 'may_reconnect': True}]) |
| 999 | |
| 1000 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 1001 | amount = 2**24 |
| 1002 | chan_amount = 100000 |
| 1003 | bitcoind.rpc.sendtoaddress(l1.rpc.newaddr()['p2tr'], amount / 10**8 + 0.01) |
| 1004 | bitcoind.generate_block(1) |
| 1005 | # Wait for it to arrive. |
| 1006 | wait_for(lambda: len(l1.rpc.listfunds()['outputs']) > 0) |
| 1007 | |
| 1008 | res = l1.rpc.fundchannel(l2.info['id'], chan_amount) |
| 1009 | chan_id = res['channel_id'] |
| 1010 | vins = bitcoind.rpc.decoderawtransaction(res['tx'])['vin'] |
| 1011 | assert(only_one(vins)) |
| 1012 | prev_utxos = ["{}:{}".format(vins[0]['txid'], vins[0]['vout'])] |
| 1013 | |
| 1014 | # Check that we're waiting for lockin |
| 1015 | l1.daemon.wait_for_log(' to DUALOPEND_AWAITING_LOCKIN') |
| 1016 | |
| 1017 | next_feerate = find_next_feerate(l1, l2) |
| 1018 | |
| 1019 | # Initiate an RBF |
| 1020 | startweight = 42 + 172 # base weight, funding output |
| 1021 | initpsbt = l1.rpc.utxopsbt(chan_amount, next_feerate, startweight, |
| 1022 | prev_utxos, reservedok=True, |
| 1023 | excess_as_change=True) |
| 1024 | |
| 1025 | # Do the bump!? |
| 1026 | for d in disconnects: |
| 1027 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 1028 | with pytest.raises(RpcError): |
| 1029 | l1.rpc.openchannel_bump(chan_id, chan_amount, initpsbt['psbt']) |
| 1030 | assert l1.rpc.getpeer(l2.info['id']) is not None |
| 1031 | |
| 1032 | # This should succeed |
| 1033 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 1034 | l1.rpc.openchannel_bump(chan_id, chan_amount, initpsbt['psbt']) |
| 1035 | |
| 1036 | |
| 1037 | @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') |
nothing calls this directly
no test coverage detected