Displays peer number when a peer is misbehaving. Also, allows logging in situations where a node which has reached it's exceeded allowance of misbehaviour fails to be disconnected.
Node id when misbehaving #7652
pull rebroad wants to merge 2 commits into bitcoin:master from rebroad:NodeIdWhenMisbehaving changing 1 files +6 −3-
rebroad commented at 11:15 AM on March 8, 2016: contributor
-
Add NodeId to CNodeState (for logging/debugging purposes) 23971c2c74
-
Show NodeId in misbehaving debug messages 346753c206
- jonasschnelli added the label P2P on Mar 8, 2016
-
in src/main.cpp:None in 346753c206
1613 | @@ -1611,12 +1614,12 @@ void Misbehaving(NodeId pnode, int howmuch) 1614 | 1615 | state->nMisbehavior += howmuch; 1616 | int banscore = GetArg("-banscore", DEFAULT_BANSCORE_THRESHOLD); 1617 | - if (state->nMisbehavior >= banscore && state->nMisbehavior - howmuch < banscore) 1618 | + if (state->nMisbehavior >= banscore && !state->fShouldBan) 1619 | { 1620 | - LogPrintf("%s: %s (%d -> %d) BAN THRESHOLD EXCEEDED\n", __func__, state->name, state->nMisbehavior-howmuch, state->nMisbehavior);
sipa commented at 8:50 PM on March 9, 2016:No need to add id to state, as CNodeState is exactly indexed by NodeId already (meaning you won't ever have a CNodeState without knowing its NodeId); specifically, pnode here contains the NodeId.
laanwj commented at 9:19 AM on March 11, 2016: memberConcept ACK, but indeed adding the id to CNodeState is not necessary.
laanwj commented at 5:01 AM on April 2, 2016: memberClosing this, it seems inactive. The idea of adding the logging is good but it introduces unnecessary state and should be solved differently.
laanwj closed this on Apr 2, 2016rebroad deleted the branch on Oct 17, 2016DrahtBot locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 18:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 18:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me