Skip to content

rpc: Assertion '!pindex || pindex->GetBlockHash() == view->GetBestBlock()' failed during gettxoutsetinfo #34263

Closed

Description

@dergoegge

The CHECK_NONFATAL check here may fail when gettxoutsetinfo is called.

rpc/blockchain.cpp:976 std::optional<kernel::CCoinsStats> GetUTXOStats(CCoinsView *, node::BlockManager &, kernel::CoinStatsHashType, const std::function<void ()> &, const CBlockIndex *, bool): Assertion `!pindex || pindex->GetBlockHash() == view->GetBestBlock()' failed.

I've not written a test for this, but looking at the code, it seems that there is a race where the coins view's best block gets updated in between here and here (e.g. because a new block is connected), causing the check to fail (resulting in an assertion failure in debug builds).

See attached debug logs for an example.

gettxoutsetinfo_check_nonfatal.log

This was found with a test running on Antithesis.

Activity

  1. w0xlt commented on Jan 29, 2026

    @w0xlt
    Contributor

    Suggested fix: #34451

  2. added 2 commits that reference this issue on Mar 19, 2026
    4169e72
    e930c6d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions