diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index f00c11eb56..ac0133cbbf 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -489,9 +489,12 @@ def sync_blocks(rpc_connections, *, wait=1, timeout=60): best_hash = [x.getbestblockhash() for x in rpc_connections] if best_hash.count(best_hash[0]) == len(rpc_connections): return + # Check that each peer has at least one connection + assert (all([len(x.getpeerinfo()) for x in rpc_connections])) time.sleep(wait) raise AssertionError("Block sync timed out:{}".format("".join("\n {!r}".format(b) for b in best_hash))) + def sync_mempools(rpc_connections, *, wait=1, timeout=60, flush_scheduler=True, wait_func=None): """ Wait until everybody has the same transactions in their memory @@ -506,6 +509,8 @@ def sync_mempools(rpc_connections, *, wait=1, timeout=60, flush_scheduler=True, for r in rpc_connections: r.syncwithvalidationinterfacequeue() return + # Check that each peer has at least one connection + assert (all([len(x.getpeerinfo()) for x in rpc_connections])) if wait_func is not None: wait_func() time.sleep(wait)