File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -2016,7 +2016,7 @@ static CBlockIndex* FindMostWorkChain() {
2016
2016
CBlockIndex *pindexTest = pindexNew;
2017
2017
bool fInvalidAncestor = false ;
2018
2018
while (pindexTest && !chainActive.Contains (pindexTest)) {
2019
- if (! pindexTest->IsValid (BLOCK_VALID_TRANSACTIONS) || !(pindexTest-> nStatus & BLOCK_HAVE_DATA) ) {
2019
+ if (pindexTest->nStatus & BLOCK_FAILED_MASK ) {
2020
2020
// Candidate has an invalid ancestor, remove entire chain from the set.
2021
2021
if (pindexBestInvalid == NULL || pindexNew->nChainWork > pindexBestInvalid->nChainWork )
2022
2022
pindexBestInvalid = pindexNew;
@@ -2026,6 +2026,7 @@ static CBlockIndex* FindMostWorkChain() {
2026
2026
setBlockIndexValid.erase (pindexFailed);
2027
2027
pindexFailed = pindexFailed->pprev ;
2028
2028
}
2029
+ setBlockIndexValid.erase (pindexTest);
2029
2030
fInvalidAncestor = true ;
2030
2031
break ;
2031
2032
}
You can’t perform that action at this time.
0 commit comments