rpc: add error for genesis block in `getblockstats` #24075

pull ghost wants to merge 1 commits into bitcoin:master from changing 1 files +4 −0
  1. ghost commented at 8:49 AM on January 15, 2022: none

    Context: https://bitcoin.stackexchange.com/questions/111815/rpc-getblockstats-call-using-genesis-block

    Master Branch:

    bitcoin-cli getblockstats 0
    
    error code: -1
    error message:
    Can't read undo data from disk
    

    PR Branch:

    bitcoin-cli getblockstats 0
    
    error code: -1
    error message:
    Undo data not available for genesis block
    
  2. add error for genesis block 8490debe66
  3. fanquake commented at 8:51 AM on January 15, 2022: member

    Pretty sure this is already being fixed in #19888.

  4. ghost commented at 8:57 AM on January 15, 2022: none

    Pretty sure this is already being fixed in #19888.

    I could not find the below code in src/rpc/blockchain.cpp which was added in https://github.com/bitcoin/bitcoin/pull/19888/commits/97f4eb50b590422678f0ad5bb4f61cc45c97dd87:

    
        // The Genesis block does not have undo data
        if (pblockindex->nHeight == 0) return blockUndo;
    
    

    EDIT: Just realized the pull request is still open. Sorry, I will close this.

  5. unknown closed this on Jan 15, 2022

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

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