aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2014-06-23 11:54:27 -0400
committerGavin Andresen <gavinandresen@gmail.com>2014-06-23 11:54:27 -0400
commit6d875669aa7ce27cc6dd371be7d8e3c9b860509e (patch)
treea18722111cb86034d8f5ea8659e2f5b924a0a351
parent0869df195cc9f71a6f45b0bc19aa49463709cf5f (diff)
parent3b1295e98878840c94db62223d1bc202d71a7366 (diff)
Merge pull request #4394 from laanwj/2014_06_rpc_tests_connectnode
qa/rpc_tests: Wait for handshake to complete in connect_nodes
-rw-r--r--qa/rpc-tests/util.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py
index eded098c7c..27c9f778f6 100644
--- a/qa/rpc-tests/util.py
+++ b/qa/rpc-tests/util.py
@@ -182,6 +182,10 @@ def wait_bitcoinds():
def connect_nodes(from_connection, node_num):
ip_port = "127.0.0.1:"+str(p2p_port(node_num))
from_connection.addnode(ip_port, "onetry")
+ # poll until version handshake complete to avoid race conditions
+ # with transaction relaying
+ while any(peer['version'] == 0 for peer in from_connection.getpeerinfo()):
+ time.sleep(0.1)
def find_output(node, txid, amount):
"""