net: correctly initialize nMinPingUsecTime #6636

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2015_09_initialize_minpingtime changing 1 files +1 −0
  1. laanwj commented at 1:45 PM on September 4, 2015: member

    nMinPingUsecTime was left uninitialized in CNode. The correct initialization for a minimum-until-now is int64_t's max value, so initialize it to that. Thanks @MarcoFalke for noticing.

  2. laanwj added the label P2P on Sep 4, 2015
  3. paveljanik commented at 2:15 PM on September 4, 2015: contributor

    tested ACK It could be shocking for some people to see:

        "minping": 0.39083,
        "minping": 0.139336,
        "minping": 9223372036854.775,
    

    ;-)

  4. sipa commented at 2:21 PM on September 4, 2015: member

    Untested ACK.

    However, if you care for bikeshedding: how about returning null, or not even including the entry if there is no result?

  5. laanwj commented at 2:24 PM on September 4, 2015: member

    I think there's some confusion here: I'm fine with changing what is returned on RPC, but that's not the point of this pull. RPC code isn't even touched. The idea is to fix the connection slot DoS exhaustion #6374, which uses this newly-introduced CNode field.

  6. laanwj force-pushed on Sep 4, 2015
  7. laanwj force-pushed on Sep 4, 2015
  8. net: correctly initialize nMinPingUsecTime
    `nMinPingUsecTime` was left uninitialized in CNode.
    The correct initialization for a minimum-until-now is int64_t's max value, so initialize it to that.
    Thanks @MarcoFalke for noticing.
    93ff1b9041
  9. sipa commented at 2:36 PM on September 4, 2015: member

    ACK on this pull :)

  10. sipa cross-referenced this on Sep 4, 2015 from issue [net] Assume inital value of nMinPingUsecTime to be int64_max by MarcoFalke
  11. laanwj merged this on Sep 4, 2015
  12. laanwj closed this on Sep 4, 2015

  13. laanwj referenced this in commit 536207f316 on Sep 4, 2015
  14. MarcoFalke commented at 3:27 PM on September 4, 2015: member

    tested ACK (3f99d70 which is about the same as the merged one)

  15. laanwj cross-referenced this on Apr 8, 2016 from issue `getpeerinfo` should report minping differently if there never was a ping by laanwj
  16. defuse cross-referenced this on Aug 16, 2016 from issue Merge upstream anti DoS patches by bitcartel
  17. MarcoFalke cross-referenced this on Jan 5, 2019 from issue refactor: Use C++11 default member initializers by MarcoFalke
  18. laanwj referenced this in commit 3f12515199 on Jan 9, 2019
  19. MarcoFalke cross-referenced this on Jan 10, 2019 from issue [refactor] CNode: Use C++11 default member initializers by MarcoFalke
  20. laanwj referenced this in commit 070eaf7fe5 on Jan 14, 2019
  21. MarcoFalke cross-referenced this on Oct 9, 2019 from issue RFC: Rust code integration by fanquake
  22. Fuzzbawls cross-referenced this on Jun 23, 2020 from issue [Net] Pre-requirements for network encapsulation by Fuzzbawls
  23. random-zebra referenced this in commit 8bbc0650e6 on Jul 1, 2020
  24. pravblockc referenced this in commit a7a5a1c067 on Aug 9, 2021
  25. pravblockc referenced this in commit 8e21d90eed on Aug 11, 2021
  26. pravblockc referenced this in commit 95d588e9b4 on Aug 11, 2021
  27. 5tefan referenced this in commit bfba8f2211 on Aug 12, 2021
  28. bitcoin 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-05-20 06:55 UTC