From 28e021bec33b4639a0435ffc4286f922b5db4dbd Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Thu, 10 Oct 2024 04:02:34 +0300 Subject: [PATCH] Fix publishing the onion - supposed to be done every 4 hours --- minode/manager.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/minode/manager.py b/minode/manager.py index ef7960c..fa2de72 100644 --- a/minode/manager.py +++ b/minode/manager.py @@ -26,8 +26,12 @@ class Manager(threading.Thread): self.last_pickled_objects = time.time() self.last_pickled_nodes = time.time() # Publish destination 5-15 minutes after start - self.last_published_destination = \ + self.last_published_i2p_destination = \ time.time() - 50 * 60 + random.uniform(-1, 1) * 300 # nosec B311 + # Publish onion 4-8 min later + self.last_published_onion_peer = \ + self.last_published_i2p_destination - 3 * 3600 + \ + random.uniform(1, 2) * 240 # nosec B311 def fill_bootstrap_pool(self): """Populate the bootstrap pool by core nodes and checked ones""" @@ -56,10 +60,12 @@ class Manager(threading.Thread): if now - self.last_pickled_nodes > 60: self.pickle_nodes() self.last_pickled_nodes = now - if now - self.last_published_destination > 3600: + if now - self.last_published_i2p_destination > 3600: self.publish_i2p_destination() + self.last_published_i2p_destination = now + if now - self.last_published_onion_peer > 3600 * 4: self.publish_onion_peer() - self.last_published_destination = now + self.last_published_onion_peer = now @staticmethod def clean_objects():