diff options
author | Jeff Garzik <jgarzik@exmulti.com> | 2012-08-01 09:06:57 -0700 |
---|---|---|
committer | Jeff Garzik <jgarzik@exmulti.com> | 2012-08-01 09:06:57 -0700 |
commit | 0ecbd46fe73cb42f3b944e5cabeb220fd4bcb2a9 (patch) | |
tree | aabc0e28755e3063e6a8604b93375a877cd7ce1f | |
parent | 3c83387c298b6462b176fe6f335502770007f192 (diff) | |
parent | 90c838da9faca667a0809a44a7b6202772de04ec (diff) |
Merge pull request #1343 from rebroad/MisbehavingDelta
Show when node is misbehaving, not just at the point that it gets banned...
-rw-r--r-- | src/net.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp index 08f47ae62f..cc1aeeff08 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -589,7 +589,7 @@ bool CNode::Misbehaving(int howmuch) { if (addr.IsLocal()) { - printf("Warning: local node %s misbehaving\n", addrName.c_str()); + printf("Warning: local node %s misbehaving (delta: %d)\n", addrName.c_str(), howmuch); return false; } @@ -597,15 +597,16 @@ bool CNode::Misbehaving(int howmuch) if (nMisbehavior >= GetArg("-banscore", 100)) { int64 banTime = GetTime()+GetArg("-bantime", 60*60*24); // Default 24-hour ban + printf("Misbehaving: %s (%d -> %d) DISCONNECTING\n", addr.ToString().c_str(), nMisbehavior-howmuch, nMisbehavior); { LOCK(cs_setBanned); if (setBanned[addr] < banTime) setBanned[addr] = banTime; } CloseSocketDisconnect(); - printf("Disconnected %s for misbehavior (score=%d)\n", addrName.c_str(), nMisbehavior); return true; - } + } else + printf("Misbehaving: %s (%d -> %d)\n", addr.ToString().c_str(), nMisbehavior-howmuch, nMisbehavior); return false; } |