diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-07-24 16:47:59 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-07-24 16:55:48 +0200 |
| commit | 70d0325999c014d9b1b0af5be0004fcccfd680e3 (patch) | |
| tree | 911d4a33b69ef3742cb2bf9d63aca047781ceb30 /src/main.cpp | |
| parent | Merge pull request #4575 (diff) | |
| parent | Only remove actualy failed blocks from setBlockIndexValid (diff) | |
| download | discoin-70d0325999c014d9b1b0af5be0004fcccfd680e3.tar.xz discoin-70d0325999c014d9b1b0af5be0004fcccfd680e3.zip | |
Merge pull request #4496
5734d4d Only remove actualy failed blocks from setBlockIndexValid (Pieter Wuille)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 84178b16e..06ce15b5b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2016,7 +2016,7 @@ static CBlockIndex* FindMostWorkChain() { CBlockIndex *pindexTest = pindexNew; bool fInvalidAncestor = false; 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. if (pindexBestInvalid == NULL || pindexNew->nChainWork > pindexBestInvalid->nChainWork) pindexBestInvalid = pindexNew; @@ -2026,6 +2026,7 @@ static CBlockIndex* FindMostWorkChain() { setBlockIndexValid.erase(pindexFailed); pindexFailed = pindexFailed->pprev; } + setBlockIndexValid.erase(pindexTest); fInvalidAncestor = true; break; } |