mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 10:19:26 +02:00
qa: Wait for txindex to avoid race condition
Can be verified to be necessary through adding std::this_thread::sleep_for(0.5s) at the beginning of TxIndex::CustomAppend.
This commit is contained in:
@ -592,3 +592,10 @@ def find_vout_for_address(node, txid, addr):
|
||||
if addr == tx["vout"][i]["scriptPubKey"]["address"]:
|
||||
return i
|
||||
raise RuntimeError("Vout not found for address: txid=%s, addr=%s" % (txid, addr))
|
||||
|
||||
|
||||
def sync_txindex(test_framework, node):
|
||||
test_framework.log.debug("Waiting for node txindex to sync")
|
||||
sync_start = int(time.time())
|
||||
test_framework.wait_until(lambda: node.getindexinfo("txindex")["txindex"]["synced"])
|
||||
test_framework.log.debug(f"Synced in {time.time() - sync_start} seconds")
|
||||
|
Reference in New Issue
Block a user