Permalink
Browse files

ban peers that send a message with an invalid hash, since continually…

… reconnecting to them wastes bandwidth
  • Loading branch information...
1 parent 8c9f2ca commit f791b509f7c0300a13407b09dd08ed0e68bef39b @forrestv forrestv committed Jan 21, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 p2pool/util/p2protocol.py
@@ -54,7 +54,7 @@ def dataReceiver(self):
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)

0 comments on commit f791b50

Please sign in to comment.