Add and use BlockManager::GetAllBlockIndices
Summary:
This concludes backport of core#24515
https://github.com/bitcoin/bitcoin/pull/24515/commits/f865cf8ded2b2fbc82a6fbc41226d991909a6880
Depends on D13023
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D13024