Skip to content

Commit 72d4c51

Browse files
authored
fix: actually use to_calculate stack in CMNHFManager::GetForBlock (dashpay#5747)
## Issue being fixed or feature implemented Fixes a bug we missed in dashpay#5736 ## What was done? Use all collected indexes, not just the last one ## How Has This Been Tested? ## Breaking Changes n/a ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
1 parent c516eb0 commit 72d4c51

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/evo/mnhftx.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,13 @@ CMNHFManager::Signals CMNHFManager::GetForBlock(const CBlockIndex* pindex)
278278

279279
const Consensus::Params& consensusParams{Params().GetConsensus()};
280280
while (!to_calculate.empty()) {
281+
const CBlockIndex* pindex_top{to_calculate.top()};
281282
CBlock block;
282-
if (!ReadBlockFromDisk(block, pindex, consensusParams)) {
283+
if (!ReadBlockFromDisk(block, pindex_top, consensusParams)) {
283284
throw std::runtime_error("failed-getehfforblock-read");
284285
}
285286
BlockValidationState state;
286-
signalsTmp = ProcessBlock(block, pindex, false, state);
287+
signalsTmp = ProcessBlock(block, pindex_top, false, state);
287288
if (!signalsTmp.has_value()) {
288289
LogPrintf("%s: process block failed due to %s\n", __func__, state.ToString());
289290
throw std::runtime_error("failed-getehfforblock-construct");

0 commit comments

Comments
 (0)