index: don't commit state in BaseIndex::Rewind
Summary:
The committed state of an index should never
be ahead of the flushed chainstate. Otherwise, in the case
of an unclean shutdown, the blocks necessary to revert
from the prematurely committed state would not be
available, which would corrupt the coinstatsindex in particular.
Instead, the index state will be committed with the next
ChainStateFlushed notification.
Test index with an unclean restart after a reorg
This is a backport of core#33212
and partial backport of core#32069 (for TestNode.kill_process)
and partial backport of https://github.com/bitcoin/bitcoin/pull/26606/commits/0b753156ce60c29efb2386954ba7555ad8f642f5 (for passing a expected_ret_code argument to TestNode.wait_until_stopped)
Depends on D18598
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18599