test: Fix intermittent issue in wallet_backwards_compatibility.py #29982
+1
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When creating and replacing a transaction using
bumpfee
, an async update is sent in the form of theTransactionAddedToMempool
andTransactionRemovedFromMempool
signals. Whenwallet_backwards_compatibility.py
createstx3_id
this way and replaces it withtx4_id
, theabandontransaction
rpc is called right after. In some cases theTransactionAddedToMempool
andTransactionRemovedFromMempool
is handled after the transaction is abandoned in the wallet, and overwrites the transaction'sabandoned
flag. This PR forces the signals to get handled beforeabandontransaction
is called by invokingself.sync_mempools
which callssyncwithvalidationinterfacequeue
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