keep trying to connect to new peers eagerly if we have no outgoing connections

This commit is contained in:
Kevin 2020-06-28 04:17:45 -05:00
parent 6738eaf222
commit 7f8e63f19b
2 changed files with 17 additions and 12 deletions

View file

@ -55,6 +55,10 @@ def get_online_peers(comm_inst: 'OnionrCommunicatorDaemon'):
if len(comm_inst.onlinePeers) == 0:
logger.debug('Couldn\'t connect to any peers.' +
f' Last node seen {last_seen} ago.')
try:
get_online_peers(comm_inst)
except RecursionError:
pass
else:
comm_inst.lastNodeSeen = time.time()
comm_inst.decrementThreadCount('get_online_peers')