validation: fix CheckBlockIndex for multiple chainstates
Summary:
Adjust CheckBlockIndex to account for
- assumed-valid block indexes lacking transaction data, and
- setBlockIndexCandidates for the background chainstate not containing certain entries which rely on assumed-valid ancestors.
Add unittest for UpdateTip behavior
This is a backport of core#21526 [8 & 12/12]
https://github.com/bitcoin/bitcoin/pull/21526/commits/8f5710fd0ac5173b577e5d00708485170b321bcc
https://github.com/bitcoin/bitcoin/pull/21526/commits/673a5bd3377929a0a6a62eda8b560e47bc2cca0c
Depends on D12279
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D12281