From e487ae91601659d74915899930eba08371534d28 Mon Sep 17 00:00:00 2001 From: Rav3nPL Date: Mon, 15 Jul 2013 12:43:51 +0200 Subject: [PATCH] less spam when 'invalid hash for' full msg only in debug mode. --- p2pool/util/p2protocol.py | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/p2pool/util/p2protocol.py b/p2pool/util/p2protocol.py index 71d56ea..6e8634e 100644 --- a/p2pool/util/p2protocol.py +++ b/p2pool/util/p2protocol.py @@ -41,7 +41,9 @@ class Protocol(protocol.Protocol): payload = yield length 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') + print 'invalid hash for', self.transport.getPeer().host, repr(command), length, checksum.encode('hex') + if p2pool.DEBUG: + print hashlib.sha256(hashlib.sha256(payload).digest()).digest()[:4].encode('hex'), payload.encode('hex') self.badPeerHappened() continue -- 1.7.1