Move loading cryptors into objectProcessor init.

This commit is contained in:
Lee Miller 2022-12-21 22:47:47 +02:00
parent 7ca18587c1
commit e4488ba370
Signed by untrusted user: lee.miller
GPG Key ID: 4F97A5EA88F4AB63
2 changed files with 3 additions and 5 deletions

View File

@ -32,7 +32,6 @@ import traceback
import defaults import defaults
# Network subsystem # Network subsystem
import network import network
import shared
import shutdown import shutdown
import state import state
@ -181,9 +180,6 @@ class Main(object):
Inventory() # init Inventory() # init
if state.enableObjProc: # Not needed if objproc is disabled if state.enableObjProc: # Not needed if objproc is disabled
shared.reloadMyAddressHashes()
shared.reloadBroadcastSendersForWhichImWatching()
# Start the address generation thread # Start the address generation thread
addressGeneratorThread = addressGenerator() addressGeneratorThread = addressGenerator()
# close the main program even if there are threads left # close the main program even if there are threads left

View File

@ -44,12 +44,14 @@ class objectProcessor(threading.Thread):
def __init__(self): def __init__(self):
threading.Thread.__init__(self, name="objectProcessor") threading.Thread.__init__(self, name="objectProcessor")
random.seed() random.seed()
sql_ready.wait()
shared.reloadMyAddressHashes()
shared.reloadBroadcastSendersForWhichImWatching()
# It may be the case that the last time Bitmessage was running, # It may be the case that the last time Bitmessage was running,
# the user closed it before it finished processing everything in the # the user closed it before it finished processing everything in the
# objectProcessorQueue. Assuming that Bitmessage wasn't closed # objectProcessorQueue. Assuming that Bitmessage wasn't closed
# forcefully, it should have saved the data in the queue into the # forcefully, it should have saved the data in the queue into the
# objectprocessorqueue table. Let's pull it out. # objectprocessorqueue table. Let's pull it out.
sql_ready.wait()
queryreturn = sqlQuery( queryreturn = sqlQuery(
'SELECT objecttype, data FROM objectprocessorqueue') 'SELECT objecttype, data FROM objectprocessorqueue')
for objectType, data in queryreturn: for objectType, data in queryreturn: