File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1954,9 +1954,11 @@ static void PruneBlockIndexCandidates() {
1954
1954
// Note that we can't delete the current block itself, as we may need to return to it later in case a
1955
1955
// reorganization to a better block fails.
1956
1956
std::set<CBlockIndex*, CBlockIndexWorkComparator>::iterator it = setBlockIndexCandidates.begin ();
1957
- while (setBlockIndexCandidates.value_comp ()(*it, chainActive.Tip ())) {
1957
+ while (it != setBlockIndexCandidates. end () && setBlockIndexCandidates.value_comp ()(*it, chainActive.Tip ())) {
1958
1958
setBlockIndexCandidates.erase (it++);
1959
1959
}
1960
+ // Either the current tip or a successor of it we're working towards is left in setBlockIndexCandidates.
1961
+ assert (!setBlockIndexCandidates.empty ());
1960
1962
}
1961
1963
1962
1964
// Try to make some progress towards making pindexMostWork the active block.
@@ -2007,8 +2009,6 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo
2007
2009
}
2008
2010
} else {
2009
2011
PruneBlockIndexCandidates ();
2010
- // Either the current tip or a successor of it we're working towards is left in setBlockIndexCandidates.
2011
- assert (!setBlockIndexCandidates.empty ());
2012
2012
if (!pindexOldTip || chainActive.Tip ()->nChainWork > pindexOldTip->nChainWork ) {
2013
2013
// We're in a better position than we were. Return temporarily to release the lock.
2014
2014
fContinue = false ;
You can’t perform that action at this time.
0 commit comments