diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2013-10-01 16:26:42 +0200 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-11-28 11:03:33 +1000 |
commit | 3779de9d8916644f9b235da68cb0d6f63a173d13 (patch) | |
tree | 7919a0a139d8aa63b1c809678a2266140f971e4a | |
parent | 56ce843314f542bcfdc10fa8367aeeb08cdb5c4c (diff) |
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
-rw-r--r-- | src/main.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index 726a49c611..fa7372d69f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3581,9 +3581,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); } @@ -3601,9 +3602,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) CValidationState state; if (ProcessBlock(state, pfrom, &block) || state.CorruptionPossible()) mapAlreadyAskedFor.erase(inv); - int nDoS; + int nDoS = 0; if (state.IsInvalid(nDoS)) - pfrom->Misbehaving(nDoS); + if (nDoS > 0) + pfrom->Misbehaving(nDoS); } |