Browse Source

Merge pull request #1343 from rebroad/MisbehavingDelta

Show when node is misbehaving, not just at the point that it gets banned...
0.8
Jeff Garzik 13 years ago
parent
commit
0ecbd46fe7
  1. 7
      src/net.cpp

7
src/net.cpp

@ -589,7 +589,7 @@ bool CNode::Misbehaving(int howmuch) @@ -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) @@ -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;
}

Loading…
Cancel
Save