From 3cb290066e514babf769c5fd2d1270e88d441f5a Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 1 Oct 2013 16:26:42 +0200 Subject: [PATCH] special case DoS value == 0 in ProcessMessage() - prevents unneeded log messages, which could make users think something bad was happening Squashed: style-police code cleanup --- src/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ad4782ff4..51703c2f2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3582,9 +3582,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (nEvicted > 0) printf("mapOrphan overflow, removed %u tx\n", nEvicted); } - int nDoS; + int nDoS = 0; if (state.IsInvalid(nDoS)) - pfrom->Misbehaving(nDoS); + if (nDoS > 0) + pfrom->Misbehaving(nDoS); } @@ -3602,9 +3603,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) CValidationState state; if (ProcessBlock(state, pfrom, &block)) mapAlreadyAskedFor.erase(inv); - int nDoS; + int nDoS = 0; if (state.IsInvalid(nDoS)) - pfrom->Misbehaving(nDoS); + if (nDoS > 0) + pfrom->Misbehaving(nDoS); }