rpc: Remove getblockheader #29646

pull fjahr wants to merge 1 commits into bitcoin:master from fjahr:2024-03-bye-getblockheader changing 32 files +39 −154
  1. fjahr commented at 12:47 PM on March 13, 2024: contributor

    The getblockheader RPC with its true/false verbosity options returns the same content as getblock with verbosity 0/1. So this is an opportunity to remove some code very cleanly, as demonstrated here.

    I looked for other issues or PRs that suggested this but wasn't successful, obviously let me know if I missed something.

    Just looking for conceptual feedback for now. When that is positive I will first run getblockheader through a depecation cycle. If it is negative I will suggest some deduplication between the two RPCs instead.

  2. rpc: Remove getblockheader
    The getblockheader RPC with it's true/false verbosity options return the same result as getblock with verbosity 0/1, so it can be cleanly removed.
    c8aeab5c6f
  3. DrahtBot commented at 12:47 PM on March 13, 2024: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  4. DrahtBot added the label RPC/REST/ZMQ on Mar 13, 2024
  5. theStack commented at 12:57 PM on March 13, 2024: contributor

    The getblockheader RPC with its true/false verbosity options returns the same content as getblock with verbosity 0/1.

    I don't think that's the case. The following two commands on mainnet return different results:

    $ ./src/bitcoin-cli getblockheader $(./src/bitcoin-cli getblockhash 830000) false
    $ ./src/bitcoin-cli getblock $(./src/bitcoin-cli getblockhash 830000) 0
    

    (What is a little confusing though is that the submitheader RPC doesn't care if there is more than 80 bytes passed, so feeding in a full block works as well. Context for other reviewers: #29478 (review))

  6. fjahr commented at 1:10 PM on March 13, 2024: contributor

    Hm, weird, the docs are the same word for word as well. (Never mind, misread) I will need to dig a bit deeper and suggest some less drastic change/clarifications.

  7. fjahr closed this on Mar 13, 2024

  8. bitcoin locked this on Mar 13, 2025

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

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