Add preciousblock tests

Rebased, improved and extended by Luke-Jr.
This commit is contained in:
Pieter Wuille
2016-08-26 23:05:26 +02:00
parent 5127c4f21c
commit 5805ac836c
3 changed files with 127 additions and 0 deletions

View File

@@ -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