@@ -342,17 +342,19 @@ def wait_for_node_exit(self, i, timeout):
342342 self .nodes [i ].process .wait (timeout )
343343
344344 def connect_nodes (self , a , b ):
345- def connect_nodes_helper (from_connection , node_num ):
346- ip_port = "127.0.0.1:" + str (p2p_port (node_num ))
347- from_connection .addnode (ip_port , "onetry" )
348- # poll until version handshake complete to avoid race conditions
349- # with transaction relaying
350- # See comments in net_processing:
351- # * Must have a version message before anything else
352- # * Must have a verack message before anything else
353- wait_until (lambda : all (peer ['version' ] != 0 for peer in from_connection .getpeerinfo ()))
354- wait_until (lambda : all (peer ['bytesrecv_per_msg' ].pop ('verack' , 0 ) == 24 for peer in from_connection .getpeerinfo ()))
355- connect_nodes_helper (self .nodes [a ], b )
345+ from_connection = self .nodes [a ]
346+ to_connection = self .nodes [b ]
347+ ip_port = "127.0.0.1:" + str (p2p_port (b ))
348+ from_connection .addnode (ip_port , "onetry" )
349+ # poll until version handshake complete to avoid race conditions
350+ # with transaction relaying
351+ # See comments in net_processing:
352+ # * Must have a version message before anything else
353+ # * Must have a verack message before anything else
354+ wait_until (lambda : all (peer ['version' ] != 0 for peer in from_connection .getpeerinfo ()))
355+ wait_until (lambda : all (peer ['version' ] != 0 for peer in to_connection .getpeerinfo ()))
356+ wait_until (lambda : all (peer ['bytesrecv_per_msg' ].pop ('verack' , 0 ) == 24 for peer in from_connection .getpeerinfo ()))
357+ wait_until (lambda : all (peer ['bytesrecv_per_msg' ].pop ('verack' , 0 ) == 24 for peer in to_connection .getpeerinfo ()))
356358
357359 def disconnect_nodes (self , a , b ):
358360 def disconnect_nodes_helper (from_connection , node_num ):
0 commit comments