From 8fc42b758d2da932e488b9ef33cf473688dd7b07 Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Thu, 21 Apr 2022 01:40:38 +0300 Subject: [PATCH] Make network insensitive to absence of onionhostname config option --- src/helper_startup.py | 2 -- src/network/connectionpool.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/helper_startup.py b/src/helper_startup.py index a8789b4a..e4c3c169 100644 --- a/src/helper_startup.py +++ b/src/helper_startup.py @@ -241,8 +241,6 @@ def updateConfig(): * defaults.networkDefaultPayloadLengthExtraBytes) ) - if not config.has_option('bitmessagesettings', 'onionhostname'): - config.set('bitmessagesettings', 'onionhostname', '') if not config.has_option('bitmessagesettings', 'onionport'): config.set('bitmessagesettings', 'onionport', '8444') if not config.has_option('bitmessagesettings', 'onionbindip'): diff --git a/src/network/connectionpool.py b/src/network/connectionpool.py index 78132cb7..2ec09d88 100644 --- a/src/network/connectionpool.py +++ b/src/network/connectionpool.py @@ -164,7 +164,7 @@ class BMConnectionPool(object): def getListeningIP(): """What IP are we supposed to be listening on?""" if config.safeGet( - "bitmessagesettings", "onionhostname").endswith(".onion"): + "bitmessagesettings", "onionhostname", "").endswith(".onion"): host = config.safeGet( "bitmessagesettings", "onionbindip") else: