aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/test_framework/util.py
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-10-18 21:35:27 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-10-18 21:36:38 +0200
commit7f71a3c591945769ad33e5734105219062311d1e (patch)
treefe9c4008eeeb0f912630ecf80b7342072f15e353 /qa/rpc-tests/test_framework/util.py
parentdf7519cbc1a9613a557bf84ad3c124795155f287 (diff)
parent5805ac836c5847bc54cbef3e71154d022ca18eda (diff)
downloadbitcoin-7f71a3c591945769ad33e5734105219062311d1e.tar.xz
Merge #6996: Add preciousblock RPC
5805ac8 Add preciousblock tests (Pieter Wuille) 5127c4f Add preciousblock RPC (Pieter Wuille)
Diffstat (limited to 'qa/rpc-tests/test_framework/util.py')
-rw-r--r--qa/rpc-tests/test_framework/util.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py
index c6b0367b41..c818af4bd7 100644
--- a/qa/rpc-tests/test_framework/util.py
+++ b/qa/rpc-tests/test_framework/util.py
@@ -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