From: Forrest Voight Date: Mon, 21 Jan 2013 20:00:18 +0000 (-0500) Subject: ban peers that send a message with an invalid hash, since continually reconnecting... X-Git-Tag: 11.2~5 X-Git-Url: https://git.novaco.in/?p=p2pool.git;a=commitdiff_plain;h=f791b509f7c0300a13407b09dd08ed0e68bef39b ban peers that send a message with an invalid hash, since continually reconnecting to them wastes bandwidth --- diff --git a/p2pool/util/p2protocol.py b/p2pool/util/p2protocol.py index 2ca3139..e1ba80c 100644 --- a/p2pool/util/p2protocol.py +++ b/p2pool/util/p2protocol.py @@ -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)