GUI RPC Console: if there is no current block number available display N/A on totalBlocks label,... #1258

pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:RPCCon_never_0_Blocks changing 1 files +2 −1
  1. Diapolo commented at 10:31 AM on May 11, 2012: none

    ...instead of 0, which can not ever be true

  2. if there is no current block number available display N/A on totalBlocks label, instead of 0, which can not ever be true 66331f2b51
  3. sipa commented at 10:34 AM on May 11, 2012: member

    The number reported by peers is actually the highest block height they have available, and this can in fact be 0 (the genesis block has number 0).

  4. sipa commented at 10:37 AM on May 11, 2012: member

    That said, N/A is probably better UI-wise.

  5. Diapolo commented at 10:39 AM on May 11, 2012: none

    That's a fact I didn't know ... but it looks kind of weird to display 0. So all nodes have at least the genesis block, which should read 1 as minimum then. How is this handled in the core?

    Edit: It would be easy to change the N/A into 1.

  6. sipa commented at 10:45 AM on May 11, 2012: member

    No, the genesis block has height 0. getnumofpeers actually returns the median reported height reported peers. This can be 0 if most peers report 0.

    But keep this pull as it is; if the number is zero it most likely means there are no peers that reported any meaningful number at all, so N/A makes that clear.

  7. laanwj commented at 1:33 PM on May 11, 2012: member

    On the testnet it will show 0 before connecting to any peers. On the normal net it defaults to the last checkpoint (so it would only go to 0 if many peers report 0). So this is mostly useful on the testnet.

  8. Diapolo commented at 1:35 PM on May 11, 2012: none

    You are free to take or discard this, as always :).

  9. laanwj commented at 1:39 PM on May 11, 2012: member

    Nah it's fine, I'll merge it. Tho we should be careful not to introduce too many translation strings in what is effectively a debugging tool.

  10. laanwj referenced this in commit 2692ed3f01 on May 11, 2012
  11. laanwj merged this on May 11, 2012
  12. laanwj closed this on May 11, 2012

  13. laanwj commented at 1:43 PM on May 11, 2012: member

    Uhm, right, of course "N/A" is already in the translation, so that isn't even a valid point here :)

  14. coblee referenced this in commit 94171c7a2f on Jul 17, 2012
  15. suprnurd referenced this in commit 621f9ebeca on Dec 5, 2017
  16. lateminer referenced this in commit 9e1d7f97c9 on Jan 22, 2019
  17. lateminer referenced this in commit be05f52000 on May 6, 2020
  18. DrahtBot locked this on Sep 8, 2021
Contributors

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-21 18:16 UTC

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