mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
Add and use BlockManager::GetAllBlockIndices
This commit is contained in:
@@ -4069,11 +4069,7 @@ bool ChainstateManager::LoadBlockIndex()
|
||||
bool ret = m_blockman.LoadBlockIndexDB();
|
||||
if (!ret) return false;
|
||||
|
||||
std::vector<CBlockIndex*> vSortedByHeight;
|
||||
vSortedByHeight.reserve(m_blockman.m_block_index.size());
|
||||
for (auto& [_, block_index] : m_blockman.m_block_index) {
|
||||
vSortedByHeight.push_back(&block_index);
|
||||
}
|
||||
std::vector<CBlockIndex*> vSortedByHeight{m_blockman.GetAllBlockIndices()};
|
||||
std::sort(vSortedByHeight.begin(), vSortedByHeight.end(),
|
||||
CBlockIndexHeightOnlyComparator());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user