diff --git a/tests/test_opening.py b/tests/test_opening.py index 30be7f12d..8bcd715fa 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -467,3 +467,40 @@ def test_rbf_reconnect_tx_sigs(node_factory, bitcoind, chainparams): l1_funding_txid = only_one(only_one(l1.rpc.listpeers()['peers'])['channels'])['funding_txid'] l2_funding_txid = only_one(only_one(l2.rpc.listpeers()['peers'])['channels'])['funding_txid'] assert l1_funding_txid == l2_funding_txid + + +@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') +@unittest.skipIf(not EXPERIMENTAL_FEATURES, "dual-funding is experimental only") +def test_rbf_no_overlap(node_factory, bitcoind, chainparams): + l1, l2 = node_factory.get_nodes(2, + opts={'dev-force-features': '+223', + 'allow_warning': True}) + + l1.rpc.connect(l2.info['id'], 'localhost', l2.port) + amount = 2**24 + chan_amount = 100000 + bitcoind.rpc.sendtoaddress(l1.rpc.newaddr()['bech32'], amount / 10**8 + 0.01) + bitcoind.rpc.sendtoaddress(l1.rpc.newaddr()['bech32'], amount / 10**8 + 0.01) + bitcoind.generate_block(1) + # Wait for it to arrive. + wait_for(lambda: len(l1.rpc.listfunds()['outputs']) > 0) + + res = l1.rpc.fundchannel(l2.info['id'], chan_amount) + chan_id = res['channel_id'] + + # Check that we're waiting for lockin + l1.daemon.wait_for_log(' to DUALOPEND_AWAITING_LOCKIN') + + next_feerate = find_next_feerate(l1, l2) + + # Initiate an RBF + startweight = 42 + 172 # base weight, funding output + initpsbt = l1.rpc.fundpsbt(chan_amount, next_feerate, startweight, + min_witness_weight=110, + excess_as_change=True) + + # Do the bump + bump = l1.rpc.openchannel_bump(chan_id, chan_amount, initpsbt['psbt']) + + with pytest.raises(RpcError, match='No overlapping input present.'): + l1.rpc.openchannel_update(chan_id, bump['psbt'])