When started together with -reindex-chainstate
, currently coinstatsindex gets corrupted and the blockfilterindex flatfiles duplicated. See the OP of #24630 for more a more detailed explanation on why this happens.
This is an alternative to #24630 which does not wipe and rebuild the indexes but returns an InitError
when they are activated, thus requiring the user to deactivate them temporarily until the -reindex-chainstate
run is finished.
This also disallows -reindex-chainstate
in combination with -txindex
, which is not leading to corruption, but currently still rebuilds the index unnecessarily and unexpectedly.
As a long-term goal, it would be desirable to have the indexes tolerate reindex-chainstate
by ignoring their BlockConnected
notifications (there is discussion in #24630 about this) or possibly move reindex-chainstate
option into a bitcoin-chainstate
executable, which could also solve the problem. But these would be larger projects - until then, it might be better to disallow the interaction than having corrupted indexes.
The first commit adjusts the -reindex
doc to mention that this option does rebuild all active indexes.