From 12f03fc891b02bb02296a2fd21363f361608c49b Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Fri, 25 Jan 2013 13:29:31 -0500 Subject: [PATCH] added error handling for when client auto-resends a message but user has deleted keys from keys.dat file --- bitmessagemain.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bitmessagemain.py b/bitmessagemain.py index 04470ec9..bbc4e964 100644 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -1726,7 +1726,9 @@ class receiveDataThread(QThread): #Sends a verack message def sendverack(self): + printLock.acquire() print 'Sending verack' + printLock.release() self.sock.sendall('\xE9\xBE\xB4\xD9\x76\x65\x72\x61\x63\x6B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcf\x83\xe1\x35') #cf 83 e1 35 self.verackSent = True @@ -2441,7 +2443,13 @@ class singleWorker(QThread): payload += encodeVarint(fromAddressVersionNumber) payload += encodeVarint(fromStreamNumber) - sendersN = convertIntToString(config.getint(fromaddress, 'n')) + try: + sendersN = convertIntToString(config.getint(fromaddress, 'n')) + except: + printLock.acquire() + print 'Error: Could not find', fromaddress, 'in our keys.dat file. You must have deleted it. Aborting the send.' + printLock.release() + return payload += encodeVarint(len(sendersN)) payload += sendersN -- 2.45.1