# It might now be possible to send msgs which were previously marked as toodifficult.
# Let us change them to 'msgqueued'. The singleWorker will try to send them and will again
# mark them as toodifficult if the receiver's required difficulty is still higher than
# we are willing to do.
sqlExecute('''UPDATE sent SET status='msgqueued' WHERE status='toodifficult'''')
shared.workerQueue.put(('sendmessage',''))
#start:UI setting to stop trying to send messages after X days/months
# I'm open to changing this UI to something else if someone has a better idea.
if((self.settingsDialogInstance.ui.lineEditDays.text()=='')and(self.settingsDialogInstance.ui.lineEditMonths.text()=='')):#We need to handle this special case. Bitmessage has its default behavior. The input is blank/blank
@ -515,14 +515,9 @@ class singleWorker(threading.Thread):
defsendMsg(self):
whileTrue:# while we have a msg that needs some work
# Select just one msg that needs work. We'll get a msg
# which is ready to be sent or a msg which we have sent in
# the last 28 days which were previously marked
# as 'toodifficult'. If the user has raised the maximum acceptable
# difficulty then those msgs may now be sendable.
# Select just one msg that needs work.
queryreturn=sqlQuery(
'''SELECT toaddress, toripe, fromaddress, subject, message, ackdata, status FROM sent WHERE (status='msgqueued' or status='doingmsgpow' or status='forcepow' or (status='toodifficult' and lastactiontime>?)) and folder='sent' LIMIT 1''',
int(time.time())-2419200)
'''SELECT toaddress, toripe, fromaddress, subject, message, ackdata, status 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.
@ -717,7 +712,7 @@ class singleWorker(threading.Thread):
sqlExecute(
'''UPDATE sent SET status='toodifficult' WHERE ackdata=? ''',
ackdata)
shared.UISignalQueue.put(('updateSentItemStatusByAckdata',(ackdata,tr.translateText("MainWindow","Problem: The work demanded by the recipient (%1 and %2) is more difficult than you are willing to do.").arg(str(float(requiredAverageProofOfWorkNonceTrialsPerByte)/shared.networkDefaultProofOfWorkNonceTrialsPerByte)).arg(str(float(
shared.UISignalQueue.put(('updateSentItemStatusByAckdata',(ackdata,tr.translateText("MainWindow","Problem: The work demanded by the recipient (%1 and %2) is more difficult than you are willing to do.%3").arg(str(float(requiredAverageProofOfWorkNonceTrialsPerByte)/shared.networkDefaultProofOfWorkNonceTrialsPerByte)).arg(str(float(