Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
When running bitcoind with -reindex-chainstate, only the UTXO set (chainstate) is rebuilt by replaying all blocks from disk. Secondary indexes (-txindex, -blockfilterindex, -coinstatsindex) are not reset or rebuilt — they remain at their previously synced state without any notification to the user.
As a result:
- No warning is emitted in
debug.logor to stdout/stderr indicating that secondary indexes were skipped during the chainstate reindex. getindexinforeports secondary indexes as fully synced (at chain tip height) even while the chainstate is being rebuilt from block 0, creating a silent consistency window where UTXO data and index data may refer to different chain states.- Users who run
-reindex-chainstateexpecting a full clean rebuild of all on-disk data structures (e.g. after suspected data corruption) are silently left with secondary indexes that were never touched.
Expected behaviour
One of the following behaviors would be appropriate:
Rebuild secondary indexes alongside chainstate:
-reindex-chainstateshould also reset and trigger a rebuild of all enabled secondary indexes (similar to what-reindexdoes), so that all on-disk data structures remain mutually consistent.Emit a clear warning at startup: At minimum, a warning should be logged at startup in
debug.logand printed to stdout explicitly stating that secondary indexes (txindex,blockfilterindex,coinstatsindex) will not be rebuilt during-reindex-chainstateand will remain at their previous state.
The -help output and documentation for -reindex-chainstate should also be updated to clearly distinguish its behavior from -reindex with respect to secondary indexes.
Steps to reproduce
- Start
bitcoindwith secondary indexes enabled and let it fully sync to chain tip:bitcoind -txindex=1 -blockfilterindex=1 -coinstatsindex=1 -daemon - Confirm all indexes are synced:
bitcoin-cli getindexinfo - Stop the node cleanly:
bitcoin-cli stop - Restart with
-reindex-chainstatewhile keeping index flags:bitcoind -txindex=1 -blockfilterindex=1 -coinstatsindex=1 -reindex-chainstate -daemon - Immediately query index status while chainstate rebuild is still in progress:
bitcoin-cli getindexinfo - Check
debug.logfor any mention of secondary indexes being skipped or requiring a rebuild.
Observed: getindexinfo reports all secondary indexes as "synced": true at their old (pre-reindex) height even as the chainstate is being rebuilt from block 0. No warning about skipped secondary indexes appears anywhere in debug.log.
Relevant log output
2026-06-17T10:23:01Z Bitcoin Core version v28.1.0 (release build)
2026-06-17T10:23:01Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
2026-06-17T10:23:01Z Reindexing chainstate from block files...
2026-06-17T10:23:01Z LoadBlockIndexDB: loading block index...
2026-06-17T10:23:01Z Verifying last 6 blocks at level 3
2026-06-17T10:23:02Z UpdateTip: new best=000000000000000000025... height=850000 ...
... (chainstate rebuild proceeds, no messages about txindex/blockfilterindex/coinstatsindex) ...
2026-06-17T10:45:33Z txindex is enabled at height 850000
2026-06-17T10:45:33Z blockfilterindex is enabled at height 850000
Note: txindex and blockfilterindex silently report as already up-to-date despite chainstate having been fully rebuilt from scratch.
How did you obtain Bitcoin Core
Compiled from source
What version of Bitcoin Core are you using?
v28.1.0
Operating system and version
Ubuntu 22.04.4 LTS (Linux 6.5.0-41-generic x86_64)
Machine specifications
- CPU: Intel Core i7-10700K (8 cores / 16 threads)
- RAM: 32 GB DDR4
- Disk: 2 TB NVMe SSD (Samsung 980 Pro) — blocks and chainstate on the same volume
- Network: 1 Gbps symmetric
- Bitcoin data dir: default (
~/.bitcoin/), non-pruned, ~650 GB used - Enabled indexes:
-txindex=1 -blockfilterindex=1 -coinstatsindex=1