(nodes, timeout_sec = 10)
| 91 | return self.config[key] |
| 92 | |
| 93 | def sync_all(nodes, timeout_sec = 10): |
| 94 | stop_time = time.time() + timeout_sec |
| 95 | while time.time() <= stop_time: |
| 96 | best_hash = [x.getbestblockhash() for x in nodes] |
| 97 | if best_hash.count(best_hash[0]) == len(nodes): |
| 98 | break |
| 99 | time.sleep(1) |
| 100 | while time.time() <= stop_time: |
| 101 | pool = [set(x.getrawmempool()) for x in nodes] |
| 102 | if pool.count(pool[0]) == len(nodes): |
| 103 | return |
| 104 | time.sleep(1) |
| 105 | raise Exception("Nodes cannot sync blocks or mempool!") |
| 106 |
no test coverage detected