mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Add preciousblock tests
Rebased, improved and extended by Luke-Jr.
This commit is contained in:
@@ -133,6 +133,16 @@ def sync_blocks(rpc_connections, wait=1, timeout=60):
|
||||
timeout -= wait
|
||||
raise AssertionError("Block sync failed")
|
||||
|
||||
def sync_chain(rpc_connections, wait=1):
|
||||
"""
|
||||
Wait until everybody has the same best block
|
||||
"""
|
||||
while True:
|
||||
counts = [ x.getbestblockhash() for x in rpc_connections ]
|
||||
if counts == [ counts[0] ]*len(counts):
|
||||
break
|
||||
time.sleep(wait)
|
||||
|
||||
def sync_mempools(rpc_connections, wait=1, timeout=60):
|
||||
"""
|
||||
Wait until everybody has the same transactions in their memory
|
||||
|
||||
Reference in New Issue
Block a user