(node_factory, bitcoind, chainparams)
| 754 | @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') |
| 755 | @pytest.mark.openchannel('v2') |
| 756 | def test_rbf_reconnect_init(node_factory, bitcoind, chainparams): |
| 757 | disconnects = ['-WIRE_TX_INIT_RBF', |
| 758 | '+WIRE_TX_INIT_RBF'] |
| 759 | |
| 760 | l1, l2 = node_factory.get_nodes(2, |
| 761 | opts=[{'disconnect': disconnects, |
| 762 | 'may_reconnect': True}, |
| 763 | {'may_reconnect': True}]) |
| 764 | |
| 765 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 766 | amount = 2**24 |
| 767 | chan_amount = 100000 |
| 768 | bitcoind.rpc.sendtoaddress(l1.rpc.newaddr()['p2tr'], amount / 10**8 + 0.01) |
| 769 | bitcoind.generate_block(1) |
| 770 | # Wait for it to arrive. |
| 771 | wait_for(lambda: len(l1.rpc.listfunds()['outputs']) > 0) |
| 772 | |
| 773 | res = l1.rpc.fundchannel(l2.info['id'], chan_amount) |
| 774 | chan_id = res['channel_id'] |
| 775 | vins = bitcoind.rpc.decoderawtransaction(res['tx'])['vin'] |
| 776 | assert(only_one(vins)) |
| 777 | prev_utxos = ["{}:{}".format(vins[0]['txid'], vins[0]['vout'])] |
| 778 | |
| 779 | # Check that we're waiting for lockin |
| 780 | l1.daemon.wait_for_log(' to DUALOPEND_AWAITING_LOCKIN') |
| 781 | |
| 782 | next_feerate = find_next_feerate(l1, l2) |
| 783 | |
| 784 | # Initiate an RBF |
| 785 | startweight = 42 + 172 # base weight, funding output |
| 786 | initpsbt = l1.rpc.utxopsbt(chan_amount, next_feerate, startweight, |
| 787 | prev_utxos, reservedok=True, |
| 788 | excess_as_change=True) |
| 789 | |
| 790 | # Do the bump!? |
| 791 | for d in disconnects: |
| 792 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 793 | with pytest.raises(RpcError): |
| 794 | l1.rpc.openchannel_bump(chan_id, chan_amount, initpsbt['psbt']) |
| 795 | assert l1.rpc.getpeer(l2.info['id']) is not None |
| 796 | |
| 797 | # This should succeed |
| 798 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 799 | l1.rpc.openchannel_bump(chan_id, chan_amount, initpsbt['psbt']) |
| 800 | |
| 801 | |
| 802 | @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') |
nothing calls this directly
no test coverage detected