RPC: do not print minping time in getpeerinfo when no ping received yet #7842

pull paveljanik wants to merge 1 commits into bitcoin:master from paveljanik:20160408_getpeerinfo_no_ping_yet changing 1 files +7 −5
  1. paveljanik commented at 4:58 PM on April 8, 2016: contributor

    When no ping received yet, minping value in getpeerinfo is uninitialized (resp. initialized to std::numeric_limits<int64_t>::max()/1e6). Do not print it in such cases.

    Document such behaviour (also for pingwait).

    Fixes #7837.

  2. MarcoFalke commented at 5:03 PM on April 8, 2016: member

    utACK

  3. laanwj commented at 7:30 AM on April 9, 2016: member

    Just realized: dPingTime suffers from the same problem if there has never been a ping. It gets initialized to zero, but that's just as well a nonsensical value if we really want to be consistent at 'leave out fields that have no value'.

  4. laanwj added the label RPC/REST/ZMQ on Apr 9, 2016
  5. paveljanik commented at 7:38 AM on April 9, 2016: contributor

    Do you want me to change it in one go?

  6. laanwj commented at 7:42 AM on April 9, 2016: member

    Do you want me to change it in one go?

    I'd say it makes sense, it's basically the same thing.

  7. RPC: do not print ping info in getpeerinfo when no ping received yet, fix help 62a6486058
  8. paveljanik force-pushed on Apr 9, 2016
  9. paveljanik commented at 7:52 AM on April 9, 2016: contributor

    Force pushed.

  10. laanwj commented at 8:16 AM on April 9, 2016: member

    Great!

  11. MarcoFalke commented at 10:28 AM on April 9, 2016: member

    utACK 62a6486

  12. sipa commented at 1:57 PM on April 12, 2016: member

    Concept ACK

  13. laanwj commented at 2:08 PM on April 14, 2016: member

    Tested ACK. New connection has neither minping, pingtime or pingwait.

    [
      {
        "id": 1,
        "addr": "127.0.0.1:56078",
        "services": "0000000000000000",
        "relaytxes": false,
        "lastsend": 0,
        "lastrecv": 0,
        "bytessent": 0,
        "bytesrecv": 0,
        "conntime": 1460642850,
        "timeoffset": 0,
        "version": 0,
        "subver": "",
        "inbound": true,
        "startingheight": -1,
        "banscore": 0,
        "synced_headers": -1,
        "synced_blocks": -1,
        "inflight": [
        ],
        "whitelisted": false,
        "bytessent_per_msg": {
        },
        "bytesrecv_per_msg": {
        }
      }
    ]
    
  14. laanwj merged this on Apr 14, 2016
  15. laanwj closed this on Apr 14, 2016

  16. laanwj referenced this in commit d97101e5a8 on Apr 14, 2016
  17. gmaxwell commented at 3:55 PM on April 14, 2016: contributor

    posthumous "hey, I was whining about that" ACK.

  18. codablock referenced this in commit 3be6690b50 on Sep 7, 2017
  19. UdjinM6 referenced this in commit 9707ca5cea on Sep 9, 2017
  20. MarcoFalke 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-13 15:15 UTC

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