diff options
author | Carl Dong <contact@carldong.me> | 2022-03-15 19:28:46 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2022-03-15 19:42:43 -0400 |
commit | f865cf8ded2b2fbc82a6fbc41226d991909a6880 (patch) | |
tree | 1f8a540512d05671c936cbe58cfb1f3b0a3c19dd /src/validation.cpp | |
parent | 28ba0313eac37e4a900b7e97af7169ce999c4024 (diff) |
Add and use BlockManager::GetAllBlockIndices
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 2828b4ae98..58488be3a7 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -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()); |