mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
test: Fix intermittent failure in rpc_net.py --v2transport
Make sure that v2 handshake is complete before comparing getpeerinfo outputs so that `transport_protocol_type` isn't stuck at 'detecting'. - on the python side, this is ensured by default `wait_for_handshake = True` inside `add_p2p_connection()`. - on the c++ side, add a wait_until statement till `transport_protocol_type = v2` so that v2 handshake is complete. Co-Authored-By: Martin Zumsande <mzumsande@gmail.com>
This commit is contained in:
parent
ba907f96ad
commit
0487f91a20
1 changed files with 2 additions and 0 deletions
|
@ -113,6 +113,8 @@ class NetTest(BitcoinTestFramework):
|
|||
self.nodes[0].setmocktime(no_version_peer_conntime)
|
||||
with self.nodes[0].wait_for_new_peer():
|
||||
no_version_peer = self.nodes[0].add_p2p_connection(P2PInterface(), send_version=False, wait_for_verack=False)
|
||||
if self.options.v2transport:
|
||||
self.wait_until(lambda: self.nodes[0].getpeerinfo()[no_version_peer_id]["transport_protocol_type"] == "v2")
|
||||
self.nodes[0].setmocktime(0)
|
||||
peer_info = self.nodes[0].getpeerinfo()[no_version_peer_id]
|
||||
peer_info.pop("addr")
|
||||
|
|
Loading…
Add table
Reference in a new issue