diff options
| author | Gavin Andresen <[email protected]> | 2014-06-23 11:54:27 -0400 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2014-06-23 11:54:27 -0400 |
| commit | 6d875669aa7ce27cc6dd371be7d8e3c9b860509e (patch) | |
| tree | a18722111cb86034d8f5ea8659e2f5b924a0a351 | |
| parent | Merge pull request #3960 (diff) | |
| parent | qa/rpc_tests: Wait for handshake to complete in connect_nodes (diff) | |
| download | discoin-6d875669aa7ce27cc6dd371be7d8e3c9b860509e.tar.xz discoin-6d875669aa7ce27cc6dd371be7d8e3c9b860509e.zip | |
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.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index eded098c7..27c9f778f 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): """ |