diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-03-02 14:14:30 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-03-31 17:03:03 -0400 |
commit | fa9064704524a0fd1fa9ea73eea45b07316ac3d1 (patch) | |
tree | 433ddf8d93da71c6c33b06ea7985bd1c6c9624cb /test/functional/p2p_leak.py | |
parent | ac5c5d0162a963be6fbaa53261c01705436a65f3 (diff) |
test: Wait for both veracks in add_p2p_connection
Diffstat (limited to 'test/functional/p2p_leak.py')
-rwxr-xr-x | test/functional/p2p_leak.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/functional/p2p_leak.py b/test/functional/p2p_leak.py index 06049db54c..2751ae6a5b 100755 --- a/test/functional/p2p_leak.py +++ b/test/functional/p2p_leak.py @@ -19,6 +19,7 @@ from test_framework.util import wait_until banscore = 10 + class CLazyNode(P2PInterface): def __init__(self): super().__init__() @@ -88,6 +89,7 @@ class CNodeNoVerackIdle(CLazyNode): self.send_message(msg_ping()) self.send_message(msg_getaddr()) + class P2PLeakTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 1 @@ -96,7 +98,11 @@ class P2PLeakTest(BitcoinTestFramework): def run_test(self): no_version_bannode = self.nodes[0].add_p2p_connection(CNodeNoVersionBan(), send_version=False, wait_for_verack=False) no_version_idlenode = self.nodes[0].add_p2p_connection(CNodeNoVersionIdle(), send_version=False, wait_for_verack=False) - no_verack_idlenode = self.nodes[0].add_p2p_connection(CNodeNoVerackIdle()) + no_verack_idlenode = self.nodes[0].add_p2p_connection(CNodeNoVerackIdle(), wait_for_verack=False) + + # Wait until we got the verack in response to the version. Though, don't wait for the other node to receive the + # verack, since we never sent one + no_verack_idlenode.wait_for_verack() wait_until(lambda: no_version_bannode.ever_connected, timeout=10, lock=mininode_lock) wait_until(lambda: no_version_idlenode.ever_connected, timeout=10, lock=mininode_lock) |