PoW Worker should wait for sql thread to init

- I think this was causing freezing queue on launch if not empty
- I can't reproduce the bug anymore
Peter Šurda 7 years ago
parent d8301ff512
commit 511b89ebbe
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

@ -51,6 +51,11 @@ class singleWorker(threading.Thread, StoppableThread):
super(singleWorker, self).stopThread()
def run(self):
while not state.sqlReady and state.shutdown == 0:
if state.shutdown > 0:
# Initialize the neededPubkeys dictionary.
queryreturn = sqlQuery(

@ -494,6 +494,8 @@ class sqlThread(threading.Thread):
parameters = (int(time.time()),)
self.cur.execute(item, parameters)
state.sqlReady = True
while True:
item = helper_sql.sqlSubmitQueue.get()
if item == 'commit':

@ -19,6 +19,8 @@ shutdown = 0 #Set to 1 by the doCleanShutdown function. Used to tell the proof o
curses = False
sqlReady = False # set to true by sqlTread when ready for processing
# If the trustedpeer option is specified in keys.dat then this will
# contain a Peer which will be connected to instead of using the
# addresses advertised by other peers. The client will only connect to