Node id when misbehaving #7652

pull rebroad wants to merge 2 commits into bitcoin:master from rebroad:NodeIdWhenMisbehaving changing 1 files +6 −3
  1. rebroad commented at 11:15 AM on March 8, 2016: contributor

    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.

  2. Add NodeId to CNodeState (for logging/debugging purposes) 23971c2c74
  3. Show NodeId in misbehaving debug messages 346753c206
  4. jonasschnelli added the label P2P on Mar 8, 2016
  5. 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.

  6. laanwj commented at 9:19 AM on March 11, 2016: member

    Concept ACK, but indeed adding the id to CNodeState is not necessary.

  7. laanwj commented at 2:32 PM on March 23, 2016: member

    @rebroad can you please process the comments here so that it can be merged?

  8. laanwj commented at 5:01 AM on April 2, 2016: member

    Closing this, it seems inactive. The idea of adding the logging is good but it introduces unnecessary state and should be solved differently.

  9. laanwj closed this on Apr 2, 2016

  10. rebroad deleted the branch on Oct 17, 2016
  11. DrahtBot 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 site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me