bitcoin-util: print genesis hash in display order #36471

pull ViniciusCestarii wants to merge 1 commits into bitcoin:master from ViniciusCestarii:util-getchainparams-genesis-order changing 7 files +7 −7
  1. ViniciusCestarii commented at 11:57 AM on October 8, 2026: contributor

    bitcoin-util getchainparams prints the genesis hash byte-reversed compared to getblockhash 0:

    bitcoin-util getchainparams | grep genesis
    

    "genesis": "6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000",

    bitcoin-cli getblockhash 0
    

    000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

    Use GetHex() instead of HexStr(), consistent with pow.limit in the same output and with the RPCs.

    The command is new in v32.0 (#35736), so I believe this should be backported before final release to avoid changing the output format afterwards.

  2. bitcoin-util: print genesis hash in display order cc8285e8c9
  3. DrahtBot commented at 11:57 AM on October 8, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK sedited, brunoerg, maflcko

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. sedited approved
  5. sedited commented at 12:02 PM on October 8, 2026: contributor

    ACK cc8285e8c98ac91a380eec899bab2aed5863a458

  6. brunoerg approved
  7. brunoerg commented at 12:24 PM on October 8, 2026: contributor

    code review ACK cc8285e8c98ac91a380eec899bab2aed5863a458

  8. sedited added the label Needs Backport (32.x) on Oct 8, 2026
  9. maflcko commented at 12:30 PM on October 8, 2026: member

    In theory, one could use something like this to make it more explicit:

    diff --git a/src/uint256.h b/src/uint256.h
    index d722916..62bb228 100644
    --- a/src/uint256.h
    +++ b/src/uint256.h
    @@ -123,2 +123,6 @@ public:
     
    +// See GetHex(). If HexStr is intended, use HexStr(std::span{self}).
    +template <unsigned int BITS>
    +std::string HexStr(const base_blob<BITS>&) = delete;
    +
     template <unsigned int BITS>
    

    But it will be a bit verbose and I am not sure if it really helps.

  10. maflcko commented at 12:30 PM on October 8, 2026: member

    lgtm ACK cc8285e8c98ac91a380eec899bab2aed5863a458

  11. sedited merged this on Oct 8, 2026
  12. sedited closed this on Oct 8, 2026

  13. fanquake referenced this in commit 101719cb43 on Oct 8, 2026
  14. fanquake commented at 8:57 PM on October 8, 2026: member

    Backported to 32.x in #36427.

  15. fanquake removed the label Needs Backport (32.x) on Oct 10, 2026
  16. fanquake referenced this in commit fce3897d0d on Oct 10, 2026

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-10-14 21:51 UTC

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