Merge bb136aaf2c into merged_master (Bitcoin PR bitcoin/bitcoin#26533)

This commit is contained in:
Byron Hambly 2025-04-09 12:28:27 +02:00
commit 6ec7ce1641
6 changed files with 130 additions and 3 deletions

View file

@ -4797,6 +4797,8 @@ bool ChainstateManager::LoadBlockIndex()
bool ret = m_blockman.LoadBlockIndexDB(*this, GetConsensus());
if (!ret) return false;
m_blockman.ScanAndUnlinkAlreadyPrunedFiles();
std::vector<CBlockIndex*> vSortedByHeight{m_blockman.GetAllBlockIndices()};
std::sort(vSortedByHeight.begin(), vSortedByHeight.end(),
CBlockIndexHeightOnlyComparator());