It seems unsafe to connect / disconnect / activate blocks while collecting stats about the current chain state.
Making a UTXO snapshot in #16899 relies on invaliding a early block to roll back to the chain, calling gettxoutsetinfo
and then calling reconsiderblock
to return to the tip. I managed to end up with a corrupt chainstate doing this. Perhaps this was a result of #16444, but I also noticed that gettxoutsetinfo
only returned once it reached the tip.
I’m not sure if this is the right approach though.
This might also help with #16979