mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-30 16:54:19 +00:00
Merge pull request #4496
5734d4d Only remove actualy failed blocks from setBlockIndexValid (Pieter Wuille)
This commit is contained in:
commit
70d0325999
@ -2016,7 +2016,7 @@ static CBlockIndex* FindMostWorkChain() {
|
|||||||
CBlockIndex *pindexTest = pindexNew;
|
CBlockIndex *pindexTest = pindexNew;
|
||||||
bool fInvalidAncestor = false;
|
bool fInvalidAncestor = false;
|
||||||
while (pindexTest && !chainActive.Contains(pindexTest)) {
|
while (pindexTest && !chainActive.Contains(pindexTest)) {
|
||||||
if (!pindexTest->IsValid(BLOCK_VALID_TRANSACTIONS) || !(pindexTest->nStatus & BLOCK_HAVE_DATA)) {
|
if (pindexTest->nStatus & BLOCK_FAILED_MASK) {
|
||||||
// Candidate has an invalid ancestor, remove entire chain from the set.
|
// Candidate has an invalid ancestor, remove entire chain from the set.
|
||||||
if (pindexBestInvalid == NULL || pindexNew->nChainWork > pindexBestInvalid->nChainWork)
|
if (pindexBestInvalid == NULL || pindexNew->nChainWork > pindexBestInvalid->nChainWork)
|
||||||
pindexBestInvalid = pindexNew;
|
pindexBestInvalid = pindexNew;
|
||||||
@ -2026,6 +2026,7 @@ static CBlockIndex* FindMostWorkChain() {
|
|||||||
setBlockIndexValid.erase(pindexFailed);
|
setBlockIndexValid.erase(pindexFailed);
|
||||||
pindexFailed = pindexFailed->pprev;
|
pindexFailed = pindexFailed->pprev;
|
||||||
}
|
}
|
||||||
|
setBlockIndexValid.erase(pindexTest);
|
||||||
fInvalidAncestor = true;
|
fInvalidAncestor = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user