Skip to content

Commit f6f082b

Browse files
committed
test: remove CNodeNoVersionIdle from p2p_leak.py
1 parent 45cf55c commit f6f082b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

test/functional/p2p_leak.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,6 @@ def on_getblocktxn(self, message): self.bad_message(message)
6464
def on_blocktxn(self, message): self.bad_message(message)
6565

6666

67-
# Node that never sends a version. This one just sits idle and hopes to receive
68-
# any message (it shouldn't!)
69-
class CNodeNoVersionIdle(CLazyNode):
70-
def __init__(self):
71-
super().__init__()
72-
73-
7467
# Node that sends a version but not a verack.
7568
class CNodeNoVerackIdle(CLazyNode):
7669
def __init__(self):
@@ -105,15 +98,20 @@ def run_test(self):
10598
# from this node anyway and verify eventual disconnection.
10699
no_version_disconnect_node = self.nodes[0].add_p2p_connection(
107100
CLazyNode(), send_version=False, wait_for_verack=False)
108-
no_version_idlenode = self.nodes[0].add_p2p_connection(CNodeNoVersionIdle(), send_version=False, wait_for_verack=False)
101+
102+
# Another peer that never sends a version. Just sits idle and hopes to receive
103+
# any message (it shouldn't!)
104+
no_version_idlenode = self.nodes[0].add_p2p_connection(CLazyNode(), send_version=False, wait_for_verack=False)
105+
106+
# Peer that sends a version but not a verack.
109107
no_verack_idlenode = self.nodes[0].add_p2p_connection(CNodeNoVerackIdle(), wait_for_verack=False)
110108

111109
# Send enough ping messages (any non-version message will do) prior to sending
112110
# version to reach the peer discouragement threshold. This should get us disconnected.
113111
for _ in range(DISCOURAGEMENT_THRESHOLD):
114112
no_version_disconnect_node.send_message(msg_ping())
115113

116-
# Wait until we got the verack in response to the version. Though, don't wait for the other node to receive the
114+
# Wait until we got the verack in response to the version. Though, don't wait for self.nodes[0] to receive the
117115
# verack, since we never sent one
118116
no_verack_idlenode.wait_for_verack()
119117

0 commit comments

Comments
 (0)