print'Proof of work in pubkey message insufficient.'
return
@ -1022,7 +1013,6 @@ class receiveDataThread(QThread):
ifqueryreturn<>[]:
forrowinqueryreturn:
objectType,payload=row
print'Sending data out of inventory that came from sql.'#todo: remove line
self.sendData(objectType,payload)
else:
print'Someone asked for an object with a getdata which is not in either our memory inventory or our SQL inventory. That shouldn\'t have happened.'
@ -1256,9 +1246,9 @@ class receiveDataThread(QThread):
#We have received a version message
defrecversion(self):
ifself.payloadLength<83:
self.data=''
#This version message is unreasonably short. Forget it.
return
else:
elif notself.verackSent:#There is a potential exploit if we don't check to make sure that we have not already received and accepted a version message: An attacker could connect directly to us, send a msg message with the ackdata set to an invalid version message which would cause us to close the connection to the attacker thus proving that we were able to decode the message. Checking the connectionIsOrWasFullyEstablished variable would also suffice.
@ -1449,9 +1427,9 @@ class sendDataThread(QThread):
self.streamNumber=specifiedStreamNumber
elifcommand=='send':
try:
#To prevent some network analysis, 'leak' the data out to our peer after waiting a sort random amount of time.
#To prevent some network analysis, 'leak' the data out to our peer after waiting a random amount of time.
random.seed()
#time.sleep(random.randrange(0, 5)) todo: uncomment this line.
time.sleep(random.randrange(0,5))
self.sock.sendall(data)
self.lastTimeISentData=int(time.time())
except:
@ -1845,7 +1823,7 @@ class singleWorker(QThread):
payload+=messageToTransmit
#Later, if anyone impliments clients that don't send the ack_data, then we should probably check here to make sure that the receiver will make use of this ack_data and not attach it if not.