From 8a4c138eed59f6b48d9c131eefe14174a370b32e Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Thu, 22 Oct 2020 12:45:19 +0000 Subject: [PATCH] don't netcheck if tor disabled --- run-onionr-node.py | 3 ++- src/communicator/__init__.py | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/run-onionr-node.py b/run-onionr-node.py index ab58cd4e..2c8f3431 100755 --- a/run-onionr-node.py +++ b/run-onionr-node.py @@ -56,7 +56,7 @@ def show_info(p: Process): parser = argparse.ArgumentParser() parser.add_argument( - "--use-bootstap-file", help="Use bootstrap node list file", + "--use-bootstrap-file", help="Use bootstrap node list file", type=int, default=1) parser.add_argument( "--show-stats", help="Display curses output of Onionr stats", @@ -128,6 +128,7 @@ config['general']['dev_mode'] = False config['general']['store_plaintext_blocks'] = True config['general']['use_bootstrap_list'] = True +config['transports']['tor'] = True if not args.use_bootstrap_file: config['general']['use_bootstrap_list'] = False diff --git a/src/communicator/__init__.py b/src/communicator/__init__.py index 99a0b329..77af2bc7 100755 --- a/src/communicator/__init__.py +++ b/src/communicator/__init__.py @@ -149,10 +149,12 @@ class OnionrCommunicatorDaemon: 180, my_args=[self], requires_peer=True, max_threads=1) deniableBlockTimer.count = (deniableBlockTimer.frequency - 175) - # Timer to check for connectivity, - # through Tor to various high-profile onion services - OnionrCommunicatorTimers(self, netcheck.net_check, 500, - my_args=[self], max_threads=1) + if config.get('transports.tor', True): + # Timer to check for connectivity, + # through Tor to various high-profile onion services + OnionrCommunicatorTimers( + self, netcheck.net_check, 500, + my_args=[self], max_threads=1) # Announce the public API server transport address # to other nodes if security level allows