| 1753 | } |
| 1754 | |
| 1755 | void Misbehaving(NodeId pnode, int howmuch) |
| 1756 | { |
| 1757 | if (howmuch == 0) |
| 1758 | return; |
| 1759 | |
| 1760 | NodeStatePtr state(pnode); |
| 1761 | if (state.IsNull()) |
| 1762 | return; |
| 1763 | |
| 1764 | state->nMisbehavior += howmuch; |
| 1765 | int banscore = GetArg("-banscore", 100); |
| 1766 | if (state->nMisbehavior >= banscore && state->nMisbehavior - howmuch < banscore) |
| 1767 | { |
| 1768 | LogPrintf("%s: %s (%d -> %d) BAN THRESHOLD EXCEEDED\n", __func__, state->name, state->nMisbehavior-howmuch, state->nMisbehavior); |
| 1769 | state->fShouldBan = true; |
| 1770 | } else |
| 1771 | LogPrintf("%s: %s (%d -> %d)\n", __func__, state->name, state->nMisbehavior-howmuch, state->nMisbehavior); |
| 1772 | } |
| 1773 | |
| 1774 | void static InvalidChainFound(CBlockIndex* pindexNew) |
| 1775 | { |