Reduce number of simultaneous bootstrappers, refill the bootstrap pool
This commit is contained in:
parent
032cfb1bab
commit
39f92fd1b2
|
@ -28,10 +28,13 @@ class Manager(threading.Thread):
|
|||
self.last_published_i2p_destination = \
|
||||
time.time() - 50 * 60 + random.uniform(-1, 1) * 300 # nosec
|
||||
|
||||
def run(self):
|
||||
self.clean_objects()
|
||||
def fill_bootstrap_pool(self):
|
||||
self.bootstrap_pool = list(shared.core_nodes.union(shared.node_pool))
|
||||
random.shuffle(self.bootstrap_pool)
|
||||
|
||||
def run(self):
|
||||
self.clean_objects()
|
||||
self.fill_bootstrap_pool()
|
||||
while True:
|
||||
time.sleep(0.8)
|
||||
now = time.time()
|
||||
|
@ -121,8 +124,13 @@ class Manager(threading.Thread):
|
|||
to_connect.update(random.sample(shared.node_pool, 8))
|
||||
else:
|
||||
to_connect.update(shared.node_pool)
|
||||
else:
|
||||
bootstrap()
|
||||
elif outgoing_connections < shared.outgoing_connections / 2:
|
||||
try:
|
||||
bootstrap()
|
||||
except IndexError:
|
||||
logging.warning(
|
||||
'Ran out of bootstrap nodes, refilling')
|
||||
self.fill_bootstrap_pool()
|
||||
|
||||
if shared.i2p_enabled:
|
||||
if len(shared.i2p_unchecked_node_pool) > 16:
|
||||
|
|
Loading…
Reference in New Issue