MCPcopy Create free account
hub / github.com/LUX-Core/lux / sync_mempools

Function sync_mempools

test/functional/test_framework/util.py:395–410  ·  view source on GitHub ↗

Wait until everybody has the same transactions in their memory pools

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

Source from the content-addressed store, hash-verified

393 raise AssertionError("Chain sync failed: Best block hashes don't match")
394
395def sync_mempools(rpc_connections, *, wait=1, timeout=60):
396 """
397 Wait until everybody has the same transactions in their memory
398 pools
399 """
400 while timeout > 0:
401 pool = set(rpc_connections[0].getrawmempool())
402 num_match = 1
403 for i in range(1, len(rpc_connections)):
404 if set(rpc_connections[i].getrawmempool()) == pool:
405 num_match = num_match + 1
406 if num_match == len(rpc_connections):
407 return
408 time.sleep(wait)
409 timeout -= wait
410 raise AssertionError("Mempool sync failed")
411
412# Transaction/Block functions
413#############################

Callers 1

sync_allMethod · 0.70

Calls 1

rangeFunction · 0.85

Tested by 1

sync_allMethod · 0.56