diff options
author | fanquake <fanquake@gmail.com> | 2023-03-28 15:18:59 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-03-28 15:41:15 +0100 |
commit | 68828288e5d35c17848ab3da8cd231d1b69651c0 (patch) | |
tree | c9a448b74a5443a62166fa53f833225fcc815600 /test | |
parent | 220008604f15d5078092dea28be3e3f7f11b6c8f (diff) | |
parent | 8aab5157c55249c9023ae4e9654f5d42aaa4f314 (diff) | |
download | bitcoin-68828288e5d35c17848ab3da8cd231d1b69651c0.tar.xz |
Merge bitcoin/bitcoin#27318: test: wallet_create_tx.py fix race
8aab5157c55249c9023ae4e9654f5d42aaa4f314 test: wallet_create_tx.py fix race (furszy)
Pull request description:
Fixes #27316
Because wallets are internally synchronized through the validation interface,
and the interface dispatches events on a worker thread, it is possible for a
transaction created by the first wallet to not arrive to the second wallet
before the second wallet attempts to use one of its outputs. This is because
we do not wait for the `BroadcastTransaction` callback during the wallet's
"submit to mempool" process. To address this in the tests, we need to
manually sync the validation queue.
ACKs for top commit:
josibake:
ACK https://github.com/bitcoin/bitcoin/pull/27318/commits/8aab5157c55249c9023ae4e9654f5d42aaa4f314
theStack:
ACK 8aab5157c55249c9023ae4e9654f5d42aaa4f314
Tree-SHA512: 76364370ab292a5c3ea1ed61cd353fc626a9e9cd6ce18464c24da1b3dcb34b65006e2bc42b84bbd25af03f9449231990bf789504728972db3217b569099eb309
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/wallet_create_tx.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/functional/wallet_create_tx.py b/test/functional/wallet_create_tx.py index 11c82e15b7..4e31b48ec0 100755 --- a/test/functional/wallet_create_tx.py +++ b/test/functional/wallet_create_tx.py @@ -92,6 +92,7 @@ class CreateTxWalletTest(BitcoinTestFramework): txid = tx_data['txid'] vout = 1 + self.nodes[0].syncwithvalidationinterfacequeue() options = {"change_position": 0, "add_inputs": False} for i in range(1, 25): options['inputs'] = [{'txid': txid, 'vout': vout}] |