Merge pull request #27 from Atheros1/ecc

added error handling for when client auto-resends a message but user has...
This commit is contained in:
Jonathan Warren 2013-01-25 10:30:58 -08:00
commit 4a78c708de

View File

@ -1726,7 +1726,9 @@ class receiveDataThread(QThread):
#Sends a verack message #Sends a verack message
def sendverack(self): def sendverack(self):
printLock.acquire()
print 'Sending verack' 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') 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 #cf 83 e1 35
self.verackSent = True self.verackSent = True
@ -2441,7 +2443,13 @@ class singleWorker(QThread):
payload += encodeVarint(fromAddressVersionNumber) payload += encodeVarint(fromAddressVersionNumber)
payload += encodeVarint(fromStreamNumber) 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 += encodeVarint(len(sendersN))
payload += sendersN payload += sendersN