MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / Misbehaving

Function Misbehaving

src/main.cpp:479–497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

477}
478
479void Misbehaving(NodeId pNode, int32_t howmuch) {
480 if (howmuch == 0)
481 return;
482
483 LOCK(cs_mapNodeState);
484 CNodeState *state = State(pNode);
485 if (state == nullptr)
486 return;
487
488 state->nMisbehavior += howmuch;
489 if (state->nMisbehavior >= SysCfg().GetArg("-banscore", 100)) {
490 LogPrint(BCLog::INFO, "Misbehaving: %s (%d -> %d) BAN THRESHOLD EXCEEDED\n", state->name,
491 state->nMisbehavior - howmuch, state->nMisbehavior);
492 state->fShouldBan = true;
493 } else {
494 LogPrint(BCLog::INFO, "Misbehaving: %s (%d -> %d)\n", state->name, state->nMisbehavior - howmuch,
495 state->nMisbehavior);
496 }
497}
498
499void static InvalidChainFound(CBlockIndex *pIndexNew) {
500 if (pIndexBestInvalid == nullptr || pIndexNew->height > pIndexBestInvalid->height) {

Callers 11

InvalidBlockFoundFunction · 0.85
ProcessMessageFunction · 0.85
AddBlockToQueueFunction · 0.85
ProcessVersionMessageFunction · 0.85
ProcessAddrMessageFunction · 0.85
ProcessInvMessageFunction · 0.85
ProcessGetDataMessageFunction · 0.85
ProcessAlertMessageFunction · 0.85
ProcessFilterLoadMessageFunction · 0.85
ProcessFilterAddMessageFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 2

GetArgMethod · 0.80
StateFunction · 0.50

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68