more verbose invalid hash message
authorForrest Voight <forrest.voight@gmail.com>
Tue, 31 Jan 2012 03:54:15 +0000 (22:54 -0500)
committerForrest Voight <forrest.voight@gmail.com>
Tue, 31 Jan 2012 03:54:15 +0000 (22:54 -0500)
p2pool/bitcoin/p2p.py

index 09a80f1..3cbe645 100644 (file)
@@ -45,7 +45,7 @@ class BaseProtocol(protocol.Protocol):
             
             if checksum is not None:
                 if hashlib.sha256(hashlib.sha256(payload).digest()).digest()[:4] != checksum:
-                    print 'invalid hash for', repr(command), checksum.encode('hex') if checksum is not None else None, repr(payload[:100].encode('hex')), len(payload)
+                    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')
                     continue
             
             type_ = getattr(self, 'message_' + command, None)