mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
fix: actually use to_calculate
stack in CMNHFManager::GetForBlock
(#5747)
## Issue being fixed or feature implemented Fixes a bug we missed in #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)_
This commit is contained in:
parent
2e01672b89
commit
bab3aa13ad
@ -278,12 +278,13 @@ CMNHFManager::Signals CMNHFManager::GetForBlock(const CBlockIndex* pindex)
|
|||||||
|
|
||||||
const Consensus::Params& consensusParams{Params().GetConsensus()};
|
const Consensus::Params& consensusParams{Params().GetConsensus()};
|
||||||
while (!to_calculate.empty()) {
|
while (!to_calculate.empty()) {
|
||||||
|
const CBlockIndex* pindex_top{to_calculate.top()};
|
||||||
CBlock block;
|
CBlock block;
|
||||||
if (!ReadBlockFromDisk(block, pindex, consensusParams)) {
|
if (!ReadBlockFromDisk(block, pindex_top, consensusParams)) {
|
||||||
throw std::runtime_error("failed-getehfforblock-read");
|
throw std::runtime_error("failed-getehfforblock-read");
|
||||||
}
|
}
|
||||||
BlockValidationState state;
|
BlockValidationState state;
|
||||||
signalsTmp = ProcessBlock(block, pindex, false, state);
|
signalsTmp = ProcessBlock(block, pindex_top, false, state);
|
||||||
if (!signalsTmp.has_value()) {
|
if (!signalsTmp.has_value()) {
|
||||||
LogPrintf("%s: process block failed due to %s\n", __func__, state.ToString());
|
LogPrintf("%s: process block failed due to %s\n", __func__, state.ToString());
|
||||||
throw std::runtime_error("failed-getehfforblock-construct");
|
throw std::runtime_error("failed-getehfforblock-construct");
|
||||||
|
Loading…
Reference in New Issue
Block a user