MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / sync_mempools

Function sync_mempools

test/functional/test_framework/util.py:394–408  ·  view source on GitHub ↗

Wait until everybody has the same transactions in their memory pools

(rpc_connections, *, wait=1, timeout=60, flush_scheduler=True)

Source from the content-addressed store, hash-verified

392 raise AssertionError("Block sync timed out:{}".format("".join("\n {!r}".format(b) for b in best_hash)))
393
394def sync_mempools(rpc_connections, *, wait=1, timeout=60, flush_scheduler=True):
395 """
396 Wait until everybody has the same transactions in their memory
397 pools
398 """
399 stop_time = time.time() + timeout
400 while time.time() <= stop_time:
401 pool = [set(r.getrawmempool()) for r in rpc_connections]
402 if pool.count(pool[0]) == len(rpc_connections):
403 if flush_scheduler:
404 for r in rpc_connections:
405 r.syncwithvalidationinterfacequeue()
406 return
407 time.sleep(wait)
408 raise AssertionError("Mempool sync timed out:{}".format("".join("\n {!r}".format(m) for m in pool)))
409
410# Transaction/Block functions
411#############################

Callers 12

run_testMethod · 0.90
run_testMethod · 0.90
test_standardness_v0Method · 0.90
transact_and_mineMethod · 0.90
run_testMethod · 0.90
run_rbf_opt_in_testMethod · 0.90
run_testMethod · 0.90
do_one_roundMethod · 0.90
run_testMethod · 0.90
sync_allMethod · 0.85

Calls 3

formatMethod · 0.80
joinMethod · 0.80
countMethod · 0.45

Tested by 4

test_standardness_v0Method · 0.72
sync_allMethod · 0.68