rpc: Clarify that block count means height excl genesis #16325

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:1907-rpcBlockCount changing 2 files +6 −7
  1. MarcoFalke commented at 4:25 PM on July 2, 2019: member

    There is a common misconception that the block count returned by the blockchain rpcs includes the genesis block. See for example the discussion in #16292 (comment).

    However, it really returns the height, which is 0 for the genesis block.

    So clarify that and also remove the misleading "longest blockchain" comment.

    Finally, fix the wallet test that incorrectly used this rpc.

  2. MarcoFalke force-pushed on Jul 2, 2019
  3. rpc: Clarify that block count means height excl genesis fab0c820fa
  4. MarcoFalke force-pushed on Jul 2, 2019
  5. DrahtBot commented at 4:37 PM on July 2, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  6. laanwj added the label RPC/REST/ZMQ on Jul 2, 2019
  7. laanwj commented at 4:50 PM on July 2, 2019: member

    However, it really returns the height, which is 0 for the genesis block.

    This has always been the case, right? I know of no other block height definition than this.

  8. MarcoFalke commented at 5:17 PM on July 2, 2019: member

    Yes, this has always been the case afaik. The documentation I am changing here was added in 22f721dbf23cf5ce9e3ded9bcfb65a3894cc0f8c (2010)

  9. promag commented at 11:51 PM on July 2, 2019: member

    ACK fab0c82, sorry for the misconception.

  10. MarcoFalke commented at 11:54 PM on July 2, 2019: member

    Eh, no worries. I look it up every time to be sure as well.

  11. laanwj merged this on Jul 3, 2019
  12. laanwj closed this on Jul 3, 2019

  13. laanwj referenced this in commit 11de669d8b on Jul 3, 2019
  14. laanwj commented at 1:01 PM on July 3, 2019: member

    sorry for the misconception.

    Yes, no worries, I kind of missed that the RPC call is called getblockcount and not getblockheight. Block count is definitely ambigious.

  15. MarcoFalke deleted the branch on Jul 3, 2019
  16. jasonbcox referenced this in commit c835e67dda on Oct 8, 2020
  17. Munkybooty referenced this in commit 01b553bf57 on Nov 4, 2021
  18. Munkybooty referenced this in commit 9363a84caa on Nov 4, 2021
  19. vijaydasmp referenced this in commit 848d55251c on Dec 7, 2021
  20. vijaydasmp referenced this in commit 5e75934e61 on Dec 11, 2021
  21. vijaydasmp referenced this in commit 1ec2d63c8f on Dec 11, 2021
  22. vijaydasmp referenced this in commit aca95b442f on Dec 13, 2021
  23. vijaydasmp referenced this in commit 33cd5f523e on Dec 14, 2021
  24. vijaydasmp referenced this in commit d55180d20c on Dec 15, 2021
  25. vijaydasmp referenced this in commit 867371b752 on Dec 15, 2021
  26. DrahtBot locked this on Dec 16, 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:14 UTC

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