don't try to connect to peers in offline mode

master
Kevin Froman 2019-12-18 04:09:37 -06:00
parent f7e2a94502
commit 00e20c54b0
1 changed files with 3 additions and 0 deletions

View File

@ -28,6 +28,9 @@ def get_online_peers(comm_inst):
]connects to more peers if we have none connected
"""
config = comm_inst.config
if config.get('general.offline_mode', False):
comm_inst.decrementThreadCount('get_online_peers')
return
logger.debug('Refreshing peer pool...')
maxPeers = int(config.get('peers.max_connect', 10))
needed = maxPeers - len(comm_inst.onlinePeers)