ban peers that send a message with an invalid hash, since continually reconnecting...
[p2pool.git] / p2pool / util / p2protocol.py
index 2ca3139..e1ba80c 100644 (file)
@@ -54,7 +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()
+                self.badPeerHappened()
                 continue
             
             type_ = getattr(self, 'message_' + command, None)