Don't set PN until message router has been instantiated

This commit is contained in:
Mark Qvist 2024-09-22 11:42:18 +02:00
parent 1e604f15a8
commit 6a21429469
1 changed files with 8 additions and 6 deletions

View File

@ -151,6 +151,7 @@ class SidebandCore():
self.default_lxm_limit = 128*1000 self.default_lxm_limit = 128*1000
self.state_db = {} self.state_db = {}
self.state_lock = Lock() self.state_lock = Lock()
self.message_router = None
self.rpc_connection = None self.rpc_connection = None
self.service_stopped = False self.service_stopped = False
self.service_context = service_context self.service_context = service_context
@ -859,12 +860,13 @@ class SidebandCore():
RNS.log("No active propagation node configured") RNS.log("No active propagation node configured")
else: else:
try: try:
self.active_propagation_node = dest if self.message_router:
self.config["last_lxmf_propagation_node"] = dest self.active_propagation_node = dest
self.message_router.set_outbound_propagation_node(dest) self.config["last_lxmf_propagation_node"] = dest
self.message_router.set_outbound_propagation_node(dest)
RNS.log("Active propagation node set to: "+RNS.prettyhexrep(dest)) RNS.log("Active propagation node set to: "+RNS.prettyhexrep(dest))
self.__save_config() self.__save_config()
except Exception as e: except Exception as e:
RNS.log("Error while setting LXMF propagation node: "+str(e), RNS.LOG_ERROR) RNS.log("Error while setting LXMF propagation node: "+str(e), RNS.LOG_ERROR)