File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed
Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change 1515#include < deploymentstatus.h>
1616#include < logging.h>
1717#include < node/blockstorage.h>
18- #include < util/irange.h>
1918#include < validation.h>
2019
2120#include < algorithm>
@@ -168,11 +167,7 @@ CCreditPool CCreditPoolManager::ConstructCreditPool(const gsl::not_null<const CB
168167 throw std::runtime_error (strprintf (" %s: failed-getcreditpool-index-duplicated" , __func__));
169168 }
170169
171- const CBlockIndex* distant_block_index = block_index;
172- for ([[maybe_unused]] auto _ : irange::range (Params ().CreditPoolPeriodBlocks ())) {
173- distant_block_index = distant_block_index->pprev ;
174- if (distant_block_index == nullptr ) break ;
175- }
170+ const CBlockIndex* distant_block_index{block_index->GetAncestor (block_index->nHeight - Params ().CreditPoolPeriodBlocks ())};
176171 CAmount distantUnlocked{0 };
177172 if (distant_block_index) {
178173 if (std::optional<CBlock> distant_block = GetBlockForCreditPool (distant_block_index, consensusParams); distant_block) {
You can’t perform that action at this time.
0 commit comments