drop connection to peer if packet with invalid hash is received, as transaction prefo...
[p2pool.git] / p2pool / util / p2protocol.py
index e3f83a2..2ca3139 100644 (file)
@@ -54,6 +54,7 @@ class Protocol(protocol.Protocol):
             
             if hashlib.sha256(hashlib.sha256(payload).digest()).digest()[:4] != checksum:
                 print 'invalid hash for', self.transport.getPeer().host, repr(command), length, checksum.encode('hex'), hashlib.sha256(hashlib.sha256(payload).digest()).digest()[:4].encode('hex'), payload.encode('hex')
+                self.transport.loseConnection()
                 continue
             
             type_ = getattr(self, 'message_' + command, None)