rpc: fix race condition in gettxoutsetinfo #34451

pull w0xlt wants to merge 1 commits into bitcoin:master from w0xlt:i_34263 changing 1 files +4 −10
  1. w0xlt commented at 6:57 pm on January 29, 2026: contributor

    Fixes #34263

    A CHECK_NONFATAL assertion failure could occur in gettxoutsetinfo when a new block was connected between capturing pindex and validating it in GetUTXOStats().

    The fix removes the early pindex capture since ComputeUTXOStats() independently fetches the current best block under lock. The response now uses stats.hashBlock and stats.nHeight (the actual computed values) instead of the potentially stale pindex.

  2. rpc: fix race condition in gettxoutsetinfo
    Fix an assertion failure in gettxoutsetinfo (issue #34263) caused by
    capturing the best block before releasing cs_main, then checking it
    against a potentially newer best block in GetUTXOStats().
    
    Remove the early pindex capture since ComputeUTXOStats() independently
    fetches the current best block under lock. Use stats.hashBlock and
    stats.nHeight (the actual computed values) instead of the potentially
    stale pindex when building the response.
    f3c1557288
  3. DrahtBot added the label RPC/REST/ZMQ on Jan 29, 2026
  4. DrahtBot commented at 6:57 pm on January 29, 2026: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK fjahr

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  5. fjahr commented at 9:54 pm on January 29, 2026: contributor

    Concept ACK

    Do you have a hint on how to reproduce the failure?


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-02-01 15:13 UTC

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