From f42e7774089bd32eaf0e941407641904417766c1 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Wed, 18 Dec 2019 04:03:55 -0600 Subject: [PATCH] make network check obey offline mode --- src/communicatorutils/netcheck.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/communicatorutils/netcheck.py b/src/communicatorutils/netcheck.py index d7aaace4..3371d97d 100755 --- a/src/communicatorutils/netcheck.py +++ b/src/communicatorutils/netcheck.py @@ -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