@@ -585,36 +585,36 @@ def test_function():
585585
586586 wait_until_helper_internal (test_function , timeout = timeout , lock = p2p_lock , timeout_factor = self .timeout_factor )
587587
588- def wait_for_connect (self , timeout = 60 ):
588+ def wait_for_connect (self , * , timeout = 60 ):
589589 test_function = lambda : self .is_connected
590590 self .wait_until (test_function , timeout = timeout , check_connected = False )
591591
592- def wait_for_disconnect (self , timeout = 60 ):
592+ def wait_for_disconnect (self , * , timeout = 60 ):
593593 test_function = lambda : not self .is_connected
594594 self .wait_until (test_function , timeout = timeout , check_connected = False )
595595
596- def wait_for_reconnect (self , timeout = 60 ):
596+ def wait_for_reconnect (self , * , timeout = 60 ):
597597 def test_function ():
598598 return self .is_connected and self .last_message .get ('version' ) and not self .supports_v2_p2p
599599 self .wait_until (test_function , timeout = timeout , check_connected = False )
600600
601601 # Message receiving helper methods
602602
603- def wait_for_tx (self , txid , timeout = 60 ):
603+ def wait_for_tx (self , txid , * , timeout = 60 ):
604604 def test_function ():
605605 if not self .last_message .get ('tx' ):
606606 return False
607607 return self .last_message ['tx' ].tx .rehash () == txid
608608
609609 self .wait_until (test_function , timeout = timeout )
610610
611- def wait_for_block (self , blockhash , timeout = 60 ):
611+ def wait_for_block (self , blockhash , * , timeout = 60 ):
612612 def test_function ():
613613 return self .last_message .get ("block" ) and self .last_message ["block" ].block .rehash () == blockhash
614614
615615 self .wait_until (test_function , timeout = timeout )
616616
617- def wait_for_header (self , blockhash , timeout = 60 ):
617+ def wait_for_header (self , blockhash , * , timeout = 60 ):
618618 def test_function ():
619619 last_headers = self .last_message .get ('headers' )
620620 if not last_headers :
@@ -623,7 +623,7 @@ def test_function():
623623
624624 self .wait_until (test_function , timeout = timeout )
625625
626- def wait_for_merkleblock (self , blockhash , timeout = 60 ):
626+ def wait_for_merkleblock (self , blockhash , * , timeout = 60 ):
627627 def test_function ():
628628 last_filtered_block = self .last_message .get ('merkleblock' )
629629 if not last_filtered_block :
@@ -632,7 +632,7 @@ def test_function():
632632
633633 self .wait_until (test_function , timeout = timeout )
634634
635- def wait_for_getdata (self , hash_list , timeout = 60 ):
635+ def wait_for_getdata (self , hash_list , * , timeout = 60 ):
636636 """Waits for a getdata message.
637637
638638 The object hashes in the inventory vector must match the provided hash_list."""
@@ -644,7 +644,7 @@ def test_function():
644644
645645 self .wait_until (test_function , timeout = timeout )
646646
647- def wait_for_getheaders (self , timeout = 60 ):
647+ def wait_for_getheaders (self , * , timeout = 60 ):
648648 """Waits for a getheaders message.
649649
650650 Receiving any getheaders message will satisfy the predicate. the last_message["getheaders"]
@@ -656,7 +656,7 @@ def test_function():
656656
657657 self .wait_until (test_function , timeout = timeout )
658658
659- def wait_for_inv (self , expected_inv , timeout = 60 ):
659+ def wait_for_inv (self , expected_inv , * , timeout = 60 ):
660660 """Waits for an INV message and checks that the first inv object in the message was as expected."""
661661 if len (expected_inv ) > 1 :
662662 raise NotImplementedError ("wait_for_inv() will only verify the first inv object" )
@@ -668,7 +668,7 @@ def test_function():
668668
669669 self .wait_until (test_function , timeout = timeout )
670670
671- def wait_for_verack (self , timeout = 60 ):
671+ def wait_for_verack (self , * , timeout = 60 ):
672672 def test_function ():
673673 return "verack" in self .last_message
674674
@@ -681,11 +681,11 @@ def send_version(self):
681681 self .send_message (self .on_connection_send_msg )
682682 self .on_connection_send_msg = None # Never used again
683683
684- def send_and_ping (self , message , timeout = 60 ):
684+ def send_and_ping (self , message , * , timeout = 60 ):
685685 self .send_message (message )
686686 self .sync_with_ping (timeout = timeout )
687687
688- def sync_with_ping (self , timeout = 60 ):
688+ def sync_with_ping (self , * , timeout = 60 ):
689689 """Ensure ProcessMessages and SendMessages is called on this connection"""
690690 # Sending two pings back-to-back, requires that the node calls
691691 # `ProcessMessage` twice, and thus ensures `SendMessages` must have
@@ -726,7 +726,7 @@ def run(self):
726726 """Start the network thread."""
727727 self .network_event_loop .run_forever ()
728728
729- def close (self , timeout = 10 ):
729+ def close (self , * , timeout = 10 ):
730730 """Close the connections and network event loop."""
731731 self .network_event_loop .call_soon_threadsafe (self .network_event_loop .stop )
732732 wait_until_helper_internal (lambda : not self .network_event_loop .is_running (), timeout = timeout )
@@ -933,7 +933,7 @@ def get_invs(self):
933933 with p2p_lock :
934934 return list (self .tx_invs_received .keys ())
935935
936- def wait_for_broadcast (self , txns , timeout = 60 ):
936+ def wait_for_broadcast (self , txns , * , timeout = 60 ):
937937 """Waits for the txns (list of txids) to complete initial broadcast.
938938 The mempool should mark unbroadcast=False for these transactions.
939939 """
0 commit comments