Misleading getblockchaininfo doc #17512

issue bip-42 opened this issue on November 19, 2019
  1. bip-42 commented at 8:05 AM on November 19, 2019: none

    The help text on the getblockchaininfo RPC states

    getblockchaininfo
    Returns an object containing various state info regarding blockchain processing.
    
    Result:
    {
     "blocks": the current number of blocks processed in the server
     "headers": the current number of headers we have validated
    ...
    }
    

    However, for both blocks and headers it returns the current height, i.e. #blocks+1.

    This can be especially confusing on regtest when working with small block numbers.

  2. bip-42 added the label Bug on Nov 19, 2019
  3. bip-42 closed this on Nov 19, 2019

  4. bip-42 reopened this on Nov 19, 2019

  5. laanwj added the label Docs on Nov 19, 2019
  6. laanwj removed the label Bug on Nov 19, 2019
  7. MarcoFalke commented at 2:02 PM on November 19, 2019: member

    This has been fixed in fab0c820fa4c0c3227eec85c64310a3bf938a149

  8. MarcoFalke closed this on Nov 19, 2019

  9. MarcoFalke commented at 2:03 PM on November 19, 2019: member

    So it returns "the height of the most-work fully-validated chain. The genesis block has height 0".

  10. DrahtBot locked this on Dec 16, 2021
Contributors
Labels

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:14 UTC

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