mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Add and use BlockManager::GetAllBlockIndices
This commit is contained in:
parent
28ba0313ea
commit
f865cf8ded
3 changed files with 15 additions and 10 deletions
|
|
@ -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());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue