From b8fb5518302c3a798dad6ba4b8eccf5aafb0c79c Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Wed, 10 Apr 2013 16:23:43 -0400 Subject: [PATCH] If user trashes message before POW completed then closes Bitmessage, don't restart the send when client starts again --- bitmessagemain.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bitmessagemain.py b/bitmessagemain.py index 5fe3fc92..8554efa0 100755 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -2146,7 +2146,7 @@ class singleWorker(QThread): #Now let us see if there are any proofs of work for msg messages that we have yet to complete.. sqlLock.acquire() t = ('doingpow',) - sqlSubmitQueue.put('SELECT toripe FROM sent WHERE status=?') + sqlSubmitQueue.put('''SELECT toripe FROM sent WHERE status=? and folder='sent' ''') sqlSubmitQueue.put(t) queryreturn = sqlReturnQueue.get() sqlLock.release() @@ -2283,7 +2283,7 @@ class singleWorker(QThread): def sendBroadcast(self): sqlLock.acquire() t = ('broadcastpending',) - sqlSubmitQueue.put('SELECT fromaddress, subject, message, ackdata FROM sent WHERE status=?') + sqlSubmitQueue.put('''SELECT fromaddress, subject, message, ackdata FROM sent WHERE status=? and folder='sent' ''') sqlSubmitQueue.put(t) queryreturn = sqlReturnQueue.get() sqlLock.release() @@ -2358,13 +2358,13 @@ class singleWorker(QThread): def sendMsg(self,toRipe): sqlLock.acquire() t = ('doingpow','findingpubkey',toRipe) - sqlSubmitQueue.put('UPDATE sent SET status=? WHERE status=? AND toripe=?') + sqlSubmitQueue.put('''UPDATE sent SET status=? WHERE status=? AND toripe=? and folder='sent' ''') sqlSubmitQueue.put(t) queryreturn = sqlReturnQueue.get() sqlSubmitQueue.put('commit') t = ('doingpow',toRipe) - sqlSubmitQueue.put('SELECT toaddress, fromaddress, subject, message, ackdata FROM sent WHERE status=? AND toripe=?') + sqlSubmitQueue.put('''SELECT toaddress, fromaddress, subject, message, ackdata FROM sent WHERE status=? AND toripe=? and folder='sent' ''') sqlSubmitQueue.put(t) queryreturn = sqlReturnQueue.get() sqlLock.release()