@@ -71,27 +71,28 @@ def __init__(
7171
7272 self .dht .store (hashlib .sha256 (b"ADDRESS" ).hexdigest (), self .public_key )
7373
74- # if self.local_test is False:
75- # attempts = 0
76- #
77- # self.debug_print("Bootstrapping...", tag="Worker")
78- # while attempts < 3 and len(self.validators) == 0:
79- # self.bootstrap()
80- # if len(self.validators) == 0:
81- # time.sleep(15)
82- # self.debug_print(
83- # "No validators found, trying again...", tag="Worker"
84- # )
85- # attempts += 1
86- #
87- # if len(self.validators) == 0:
88- # self.debug_print(
89- # "No validators found, shutting down...",
90- # level=logging.CRITICAL,
91- # tag="Worker",
92- # )
93- # self.stop()
94- # self.terminate_flag.set()
74+ if not self .local_test and not self .off_chain_test :
75+ attempts = 0
76+
77+ self .debug_print ("Bootstrapping..." , tag = "Worker" )
78+ while attempts < 3 and len (self .validators ) == 0 :
79+ self .bootstrap ()
80+ if len (self .validators ) == 0 :
81+ time .sleep (15 )
82+ self .debug_print (
83+ "No validators found, trying again..." , tag = "Worker"
84+ )
85+ attempts += 1
86+
87+ if len (self .validators ) == 0 :
88+ self .debug_print (
89+ "No validators found, shutting down..." ,
90+ level = logging .CRITICAL ,
91+ tag = "Worker" ,
92+ )
93+ self .stop ()
94+ self .terminate_flag .set ()
95+
9596 self .keeper .load_previous_state ()
9697
9798 def handle_data (self , data : bytes , node : Connection ):
0 commit comments