- fixes "fast python" (multiprocessing) PoW
- python PoW (both slow and fast) interruptible on *NIX
- signal handler should handle multiple processes and threads correctly
(only tested on Linux)
- popul window asking whether to interrupt PoW when quitting QT GUI
- PoW status in "sent" folder fixes and now also displays broadcast
status which didn't exist before
- Fixes#894
self.statusBar().showMessage(_translate("MainWindow","Waiting for objects to be sent... %1%").arg(str(50)))
maxWaitingObjects=0
curWaitingObjects=1
whilecurWaitingObjects>0:
curWaitingObjects=0
forthreadinthreading.enumerate():
try:
ifisinstance(thread,objectHashHolder):
curWaitingObjects+=thread.hashCount()
except:
pass
ifcurWaitingObjects>maxWaitingObjects:
maxWaitingObjects=curWaitingObjects
ifcurWaitingObjects>0:
self.statusBar().showMessage(_translate("MainWindow","Waiting for objects to be sent... %1%").arg(str(50+20*(maxWaitingObjects-curWaitingObjects)/maxWaitingObjects)))
self.statusBar().showMessage(_translate("MainWindow","Waiting for objects to be sent... %1%").arg(str(50)))
maxWaitingObjects=0
curWaitingObjects=invQueueSize()
whilecurWaitingObjects>0:
curWaitingObjects=invQueueSize()
ifcurWaitingObjects>maxWaitingObjects:
maxWaitingObjects=curWaitingObjects
ifcurWaitingObjects>0:
self.statusBar().showMessage(_translate("MainWindow","Waiting for objects to be sent... %1%").arg(str(50+20*(maxWaitingObjects-curWaitingObjects)/maxWaitingObjects)))
@ -496,15 +499,12 @@ class singleWorker(threading.Thread, StoppableThread):
defsendMsg(self):
whileTrue:# while we have a msg that needs some work
# Select just one msg that needs work.
queryreturn=sqlQuery(
'''SELECT toaddress, fromaddress, subject, message, ackdata, status, ttl, retrynumber FROM sent WHERE (status='msgqueued' or status='doingmsgpow' or status='forcepow') and folder='sent' LIMIT 1''')
iflen(queryreturn)==0:# if there is no work to do then
break# break out of this sendMsg loop and
# wait for something to get put in the shared.workerQueue.
row=queryreturn[0]
# Reset just in case
sqlExecute(
'''UPDATE sent SET status='msgqueued' WHERE status IN ('doingpubkeypow', 'doingmsgpow')''')
queryreturn=sqlQuery(
'''SELECT toaddress, fromaddress, subject, message, ackdata, status, ttl, retrynumber FROM sent WHERE (status='msgqueued' or status='forcepow') and folder='sent'''')
forrowinqueryreturn:# while we have a msg that needs some work