Merge #6996: Add preciousblock RPC

5805ac8 Add preciousblock tests (Pieter Wuille)
5127c4f Add preciousblock RPC (Pieter Wuille)
This commit is contained in:
Wladimir J. van der Laan
2016-10-18 21:35:27 +02:00
7 changed files with 207 additions and 3 deletions

View File

@@ -137,6 +137,16 @@ def sync_blocks(rpc_connections, wait=1, timeout=60):
maxheight = max(heights)
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