@@ -585,36 +585,36 @@ def test_function():
585
585
586
586
wait_until_helper_internal (test_function , timeout = timeout , lock = p2p_lock , timeout_factor = self .timeout_factor )
587
587
588
- def wait_for_connect (self , timeout = 60 ):
588
+ def wait_for_connect (self , * , timeout = 60 ):
589
589
test_function = lambda : self .is_connected
590
590
self .wait_until (test_function , timeout = timeout , check_connected = False )
591
591
592
- def wait_for_disconnect (self , timeout = 60 ):
592
+ def wait_for_disconnect (self , * , timeout = 60 ):
593
593
test_function = lambda : not self .is_connected
594
594
self .wait_until (test_function , timeout = timeout , check_connected = False )
595
595
596
- def wait_for_reconnect (self , timeout = 60 ):
596
+ def wait_for_reconnect (self , * , timeout = 60 ):
597
597
def test_function ():
598
598
return self .is_connected and self .last_message .get ('version' ) and not self .supports_v2_p2p
599
599
self .wait_until (test_function , timeout = timeout , check_connected = False )
600
600
601
601
# Message receiving helper methods
602
602
603
- def wait_for_tx (self , txid , timeout = 60 ):
603
+ def wait_for_tx (self , txid , * , timeout = 60 ):
604
604
def test_function ():
605
605
if not self .last_message .get ('tx' ):
606
606
return False
607
607
return self .last_message ['tx' ].tx .rehash () == txid
608
608
609
609
self .wait_until (test_function , timeout = timeout )
610
610
611
- def wait_for_block (self , blockhash , timeout = 60 ):
611
+ def wait_for_block (self , blockhash , * , timeout = 60 ):
612
612
def test_function ():
613
613
return self .last_message .get ("block" ) and self .last_message ["block" ].block .rehash () == blockhash
614
614
615
615
self .wait_until (test_function , timeout = timeout )
616
616
617
- def wait_for_header (self , blockhash , timeout = 60 ):
617
+ def wait_for_header (self , blockhash , * , timeout = 60 ):
618
618
def test_function ():
619
619
last_headers = self .last_message .get ('headers' )
620
620
if not last_headers :
@@ -623,7 +623,7 @@ def test_function():
623
623
624
624
self .wait_until (test_function , timeout = timeout )
625
625
626
- def wait_for_merkleblock (self , blockhash , timeout = 60 ):
626
+ def wait_for_merkleblock (self , blockhash , * , timeout = 60 ):
627
627
def test_function ():
628
628
last_filtered_block = self .last_message .get ('merkleblock' )
629
629
if not last_filtered_block :
@@ -632,7 +632,7 @@ def test_function():
632
632
633
633
self .wait_until (test_function , timeout = timeout )
634
634
635
- def wait_for_getdata (self , hash_list , timeout = 60 ):
635
+ def wait_for_getdata (self , hash_list , * , timeout = 60 ):
636
636
"""Waits for a getdata message.
637
637
638
638
The object hashes in the inventory vector must match the provided hash_list."""
@@ -644,7 +644,7 @@ def test_function():
644
644
645
645
self .wait_until (test_function , timeout = timeout )
646
646
647
- def wait_for_getheaders (self , timeout = 60 ):
647
+ def wait_for_getheaders (self , * , timeout = 60 ):
648
648
"""Waits for a getheaders message.
649
649
650
650
Receiving any getheaders message will satisfy the predicate. the last_message["getheaders"]
@@ -656,7 +656,7 @@ def test_function():
656
656
657
657
self .wait_until (test_function , timeout = timeout )
658
658
659
- def wait_for_inv (self , expected_inv , timeout = 60 ):
659
+ def wait_for_inv (self , expected_inv , * , timeout = 60 ):
660
660
"""Waits for an INV message and checks that the first inv object in the message was as expected."""
661
661
if len (expected_inv ) > 1 :
662
662
raise NotImplementedError ("wait_for_inv() will only verify the first inv object" )
@@ -668,7 +668,7 @@ def test_function():
668
668
669
669
self .wait_until (test_function , timeout = timeout )
670
670
671
- def wait_for_verack (self , timeout = 60 ):
671
+ def wait_for_verack (self , * , timeout = 60 ):
672
672
def test_function ():
673
673
return "verack" in self .last_message
674
674
@@ -681,11 +681,11 @@ def send_version(self):
681
681
self .send_message (self .on_connection_send_msg )
682
682
self .on_connection_send_msg = None # Never used again
683
683
684
- def send_and_ping (self , message , timeout = 60 ):
684
+ def send_and_ping (self , message , * , timeout = 60 ):
685
685
self .send_message (message )
686
686
self .sync_with_ping (timeout = timeout )
687
687
688
- def sync_with_ping (self , timeout = 60 ):
688
+ def sync_with_ping (self , * , timeout = 60 ):
689
689
"""Ensure ProcessMessages and SendMessages is called on this connection"""
690
690
# Sending two pings back-to-back, requires that the node calls
691
691
# `ProcessMessage` twice, and thus ensures `SendMessages` must have
@@ -726,7 +726,7 @@ def run(self):
726
726
"""Start the network thread."""
727
727
self .network_event_loop .run_forever ()
728
728
729
- def close (self , timeout = 10 ):
729
+ def close (self , * , timeout = 10 ):
730
730
"""Close the connections and network event loop."""
731
731
self .network_event_loop .call_soon_threadsafe (self .network_event_loop .stop )
732
732
wait_until_helper_internal (lambda : not self .network_event_loop .is_running (), timeout = timeout )
@@ -933,7 +933,7 @@ def get_invs(self):
933
933
with p2p_lock :
934
934
return list (self .tx_invs_received .keys ())
935
935
936
- def wait_for_broadcast (self , txns , timeout = 60 ):
936
+ def wait_for_broadcast (self , txns , * , timeout = 60 ):
937
937
"""Waits for the txns (list of txids) to complete initial broadcast.
938
938
The mempool should mark unbroadcast=False for these transactions.
939
939
"""
0 commit comments