@@ -88,6 +88,7 @@ def run_test(self):
8888 test_nonrbf_bumpfee_fails (self , peer_node , dest_address )
8989 test_notmine_bumpfee (self , rbf_node , peer_node , dest_address )
9090 test_bumpfee_with_descendant_fails (self , rbf_node , rbf_node_address , dest_address )
91+ test_bumpfee_with_abandoned_descendant_succeeds (self , rbf_node , rbf_node_address , dest_address )
9192 test_dust_to_fee (self , rbf_node , dest_address )
9293 test_watchonly_psbt (self , peer_node , rbf_node , dest_address )
9394 test_rebumping (self , rbf_node , dest_address )
@@ -286,6 +287,35 @@ def test_bumpfee_with_descendant_fails(self, rbf_node, rbf_node_address, dest_ad
286287 self .clear_mempool ()
287288
288289
290+ def test_bumpfee_with_abandoned_descendant_succeeds (self , rbf_node , rbf_node_address , dest_address ):
291+ self .log .info ('Test that fee can be bumped when it has abandoned descendant' )
292+ # parent is send-to-self, so we don't have to check which output is change when creating the child tx
293+ parent_id = spend_one_input (rbf_node , rbf_node_address )
294+ # Submit child transaction with low fee
295+ child_id = rbf_node .send (outputs = {dest_address : 0.00020000 },
296+ options = {"inputs" : [{"txid" : parent_id , "vout" : 0 }], "fee_rate" : 2 })["txid" ]
297+ assert child_id in rbf_node .getrawmempool ()
298+
299+ # Restart the node with higher min relay fee so the descendant tx is no longer in mempool so that we can abandon it
300+ self .restart_node (1 , ['-minrelaytxfee=0.00005' ] + self .extra_args [1 ])
301+ rbf_node .walletpassphrase (WALLET_PASSPHRASE , WALLET_PASSPHRASE_TIMEOUT )
302+ self .connect_nodes (1 , 0 )
303+ assert parent_id in rbf_node .getrawmempool ()
304+ assert child_id not in rbf_node .getrawmempool ()
305+ # Should still raise an error even if not in mempool
306+ assert_raises_rpc_error (- 8 , "Transaction has descendants in the wallet" , rbf_node .bumpfee , parent_id )
307+ # Now abandon the child transaction and bump the original
308+ rbf_node .abandontransaction (child_id )
309+ bumped_result = rbf_node .bumpfee (parent_id , {"fee_rate" : HIGH })
310+ assert bumped_result ['txid' ] in rbf_node .getrawmempool ()
311+ assert parent_id not in rbf_node .getrawmempool ()
312+ # Cleanup
313+ self .restart_node (1 , self .extra_args [1 ])
314+ rbf_node .walletpassphrase (WALLET_PASSPHRASE , WALLET_PASSPHRASE_TIMEOUT )
315+ self .connect_nodes (1 , 0 )
316+ self .clear_mempool ()
317+
318+
289319def test_small_output_with_feerate_succeeds (self , rbf_node , dest_address ):
290320 self .log .info ('Testing small output with feerate bump succeeds' )
291321
0 commit comments