Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#29982: test: Fix intermittent issue in wallet_b…
Browse files Browse the repository at this point in the history
…ackwards_compatibility.py

ec77791 test: Fix intermittent issue in wallet_backwards_compatibility.py (Randall Naar)

Pull request description:

  When creating and replacing a transaction using `bumpfee`, an async update is sent in the form of the `TransactionAddedToMempool` and `TransactionRemovedFromMempool` signals. When `wallet_backwards_compatibility.py` creates `tx3_id` this way and replaces it with `tx4_id`, the `abandontransaction` rpc is called right after. In some cases the `TransactionAddedToMempool` and `TransactionRemovedFromMempool` is handled after the transaction is abandoned in the wallet, and overwrites the transaction's `abandoned` flag. This PR forces the signals to get handled before `abandontransaction` is called by invoking `self.sync_mempools` which calls `syncwithvalidationinterfacequeue` on every node's rpc connection.

  This will mitigate the immediate inconsistency observed with the abandontransaction call, but the potential race conditions between the signals and wallet operations may also be useful to note in a separate issue (if it's okay to not address it in this one).

  Fixes #29806

ACKs for top commit:
  achow101:
    ACK ec77791
  tdb3:
    ACK ec77791

Tree-SHA512: e75bc2c1f7fefc4f4910bb353654848fed5661c1436416798a5f4e0c5a76bde15617a5af04c2384464005953326317b8f273039e47508d5124677908cf36d31e
  • Loading branch information
achow101 committed Dec 10, 2024
2 parents 37e49c2 + ec77791 commit a582ee6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/functional/wallet_backwards_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def run_test(self):
# Create another conflicting transaction using RBF
tx3_id = node_master.sendtoaddress(return_address, 1)
tx4_id = node_master.bumpfee(tx3_id)["txid"]
self.sync_mempools()
# Abandon transaction, but don't confirm
node_master.abandontransaction(tx3_id)

Expand Down

0 comments on commit a582ee6

Please sign in to comment.