make network check obey offline mode

master
Kevin Froman 2019-12-18 04:03:55 -06:00
parent abe1dde57e
commit f42e777408
1 changed files with 6 additions and 3 deletions

View File

@ -37,9 +37,12 @@ def net_check(comm_inst):
pass
if not rec and not netutils.checkNetwork(torPort=comm_inst.proxyPort):
if not comm_inst.shutdown:
logger.warn('Network check failed, are you connected to the Internet, and is Tor working?', terminal=True)
restarttor.restart(comm_inst)
comm_inst.offlinePeers = []
if not comm_inst.config.get('general.offline_mode', False):
logger.warn('Network check failed, are you connected to ' +
'the Internet, and is Tor working?',
terminal=True)
restarttor.restart(comm_inst)
comm_inst.offlinePeers = []
comm_inst.isOnline = False
else:
comm_inst.isOnline = True