Skip to content

Commit 4ac8c89

Browse files
committed
test: check that bumpfee RPC fails for txs with descendants in mempool
This commit adds missing test coverage for the bumpfee RPC error "Transaction has descendants in the mempool", which is thrown if the bumped tx has descendants in the mempool and is _not_ connected to the bitcoin wallet. To achieve that, the test framework's MiniWallet is used.
1 parent 6419bdf commit 4ac8c89

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/functional/wallet_bumpfee.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
assert_greater_than,
3333
assert_raises_rpc_error,
3434
)
35+
from test_framework.wallet import MiniWallet
36+
3537

3638
WALLET_PASSPHRASE = "test"
3739
WALLET_PASSPHRASE_TIMEOUT = 3600
@@ -265,6 +267,14 @@ def test_bumpfee_with_descendant_fails(self, rbf_node, rbf_node_address, dest_ad
265267
tx = rbf_node.signrawtransactionwithwallet(tx)
266268
rbf_node.sendrawtransaction(tx["hex"])
267269
assert_raises_rpc_error(-8, "Transaction has descendants in the wallet", rbf_node.bumpfee, parent_id)
270+
271+
# create tx with descendant in the mempool by using MiniWallet
272+
miniwallet = MiniWallet(rbf_node)
273+
parent_id = spend_one_input(rbf_node, miniwallet.get_address())
274+
tx = rbf_node.gettransaction(txid=parent_id, verbose=True)['decoded']
275+
miniwallet.scan_tx(tx)
276+
miniwallet.send_self_transfer(from_node=rbf_node)
277+
assert_raises_rpc_error(-8, "Transaction has descendants in the mempool", rbf_node.bumpfee, parent_id)
268278
self.clear_mempool()
269279

270280

0 commit comments

Comments
 (0)