Show when node is misbehaving, not just at the point that it gets banned... #1343

pull rebroad wants to merge 1 commits into bitcoin:master from rebroad:MisbehavingDelta changing 1 files +4 −3
  1. rebroad commented at 9:08 PM on May 17, 2012: contributor

    subject says it all really...

  2. jgarzik commented at 9:45 PM on May 17, 2012: contributor

    This changes the accounting to include the local node, which is probably incorrect

  3. rebroad commented at 8:32 AM on May 18, 2012: contributor

    @jgarzik are you sure? I thought my edit simply added a printf, but doesn't change the logic. I've just double-check. Yup, it doesn't change the way local nodes are treated, it just reports when it happens now.

  4. jgarzik commented at 3:24 PM on May 18, 2012: contributor

    nMisbehavior increment was moved prior to the IsLocal() test, changing behavior.

  5. gavinandresen commented at 1:14 PM on May 19, 2012: contributor

    NACK because of the nMisbehavior change, we don't want IsLocal nodes getting banned.

  6. TheBlueMatt commented at 2:31 PM on May 20, 2012: member

    ACK, if/when the "nMisbehavior += howmuch;" line is moved back to its original position.

  7. rebroad commented at 10:13 AM on May 21, 2012: contributor

    Ah. Sorry, yes, @jgarzik, I do see what you mean now. I shall move the nMishehavior line back to its original location. Doing so now.

  8. rebroad commented at 10:19 AM on May 21, 2012: contributor

    Ok. Now updated. The only change now is the printfs, and the change of nMisbehaviour is no longer moved. This move would not have changed anything though, as the only place where the value is read is in this function, and it's only acted upon if the peer is NOT local, so the treatment of local nodes did remain the same, other than the value of nMisbehaviour changing but not being acted upon.

  9. sipa commented at 7:48 PM on June 12, 2012: member

    ACK.

  10. in src/net.cpp:None in 3a997f5830 outdated
     585 | +        printf("Warning: local node %s misbehaving (delta: %d)\n", addrName.c_str(), howmuch);
     586 |          return false;
     587 |      }
     588 |  
     589 |      nMisbehavior += howmuch;
     590 | +    printf("Misbehaving: %s (%d -> %d)\n", addr.ToString().c_str(), nMisbehavior-howmuch, nMisbehavior);
    


    TheBlueMatt commented at 7:51 PM on June 12, 2012:

    Can you throw in a flag in this line that says DISCONNECTING or something?


    Diapolo commented at 8:47 PM on June 12, 2012:

    I suggest "Disconnecting for misbehavior:".


    rebroad commented at 4:34 PM on June 14, 2012:

    There is already a line that says when it disconnects, so with this patch, you'll see the Misbehaving: (80 -> 100), followed by a line that says disconnecting. It can be derived that the disconnection was for misbehaviour as the two lines would be together, and the Misbehaving number would clearly have reached 100 (or higher).


    Diapolo commented at 4:36 PM on June 14, 2012:

    Can those 2 be merged into 1 line without breaking any other important infos? Would be a nice thing.


    rebroad commented at 8:59 PM on July 2, 2012:

    Changes made based upon feedback.

  11. Show when node is misbehaving, not just at the point that it gets banned. 90c838da9f
  12. TheBlueMatt commented at 9:01 PM on July 2, 2012: member

    ACK

  13. jgarzik commented at 9:11 PM on July 2, 2012: contributor

    ACK

  14. jgarzik referenced this in commit 0ecbd46fe7 on Aug 1, 2012
  15. jgarzik merged this on Aug 1, 2012
  16. jgarzik closed this on Aug 1, 2012

  17. suprnurd referenced this in commit 31d8e03a2b on Dec 5, 2017
  18. lateminer referenced this in commit 735d8ddb4d on May 6, 2020
  19. lateminer referenced this in commit abdc0e762e on May 6, 2020
  20. 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:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me