aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_leak.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/p2p_leak.py')
-rwxr-xr-xtest/functional/p2p_leak.py8
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)