@@ -64,13 +64,6 @@ def on_getblocktxn(self, message): self.bad_message(message)
64
64
def on_blocktxn (self , message ): self .bad_message (message )
65
65
66
66
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
-
74
67
# Node that sends a version but not a verack.
75
68
class CNodeNoVerackIdle (CLazyNode ):
76
69
def __init__ (self ):
@@ -105,15 +98,20 @@ def run_test(self):
105
98
# from this node anyway and verify eventual disconnection.
106
99
no_version_disconnect_node = self .nodes [0 ].add_p2p_connection (
107
100
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.
109
107
no_verack_idlenode = self .nodes [0 ].add_p2p_connection (CNodeNoVerackIdle (), wait_for_verack = False )
110
108
111
109
# Send enough ping messages (any non-version message will do) prior to sending
112
110
# version to reach the peer discouragement threshold. This should get us disconnected.
113
111
for _ in range (DISCOURAGEMENT_THRESHOLD ):
114
112
no_version_disconnect_node .send_message (msg_ping ())
115
113
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
117
115
# verack, since we never sent one
118
116
no_verack_idlenode .wait_for_verack ()
119
117
0 commit comments