From e4488ba3707f4972469fe2e83fda64b93ab8e47b Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Wed, 21 Dec 2022 22:47:47 +0200 Subject: [PATCH] Move loading cryptors into objectProcessor init. --- src/bitmessagemain.py | 4 ---- src/class_objectProcessor.py | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 90ccf3b7..8d73786e 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -32,7 +32,6 @@ import traceback import defaults # Network subsystem import network -import shared import shutdown import state @@ -181,9 +180,6 @@ class Main(object): Inventory() # init if state.enableObjProc: # Not needed if objproc is disabled - shared.reloadMyAddressHashes() - shared.reloadBroadcastSendersForWhichImWatching() - # Start the address generation thread addressGeneratorThread = addressGenerator() # close the main program even if there are threads left diff --git a/src/class_objectProcessor.py b/src/class_objectProcessor.py index b83a0b50..0d3a161a 100644 --- a/src/class_objectProcessor.py +++ b/src/class_objectProcessor.py @@ -44,12 +44,14 @@ class objectProcessor(threading.Thread): def __init__(self): threading.Thread.__init__(self, name="objectProcessor") random.seed() + sql_ready.wait() + shared.reloadMyAddressHashes() + shared.reloadBroadcastSendersForWhichImWatching() # It may be the case that the last time Bitmessage was running, # the user closed it before it finished processing everything in the # objectProcessorQueue. Assuming that Bitmessage wasn't closed # forcefully, it should have saved the data in the queue into the # objectprocessorqueue table. Let's pull it out. - sql_ready.wait() queryreturn = sqlQuery( 'SELECT objecttype, data FROM objectprocessorqueue') for objectType, data in queryreturn: