aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2014-07-09 17:42:50 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2014-07-09 18:30:44 +0200
commit5734d4d1e6ee89361fc2484f5d33315397796c0d (patch)
tree1bfa75c6ade88ffff3568123501997ae15249910 /src
parent52a7d52ffb84fb1c7bcdffd8c82e546832498a3b (diff)
downloadbitcoin-5734d4d1e6ee89361fc2484f5d33315397796c0d.tar.xz
Only remove actualy failed blocks from setBlockIndexValid
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a9c080ffae..913a1702eb 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2073,7 +2073,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;
@@ -2083,6 +2083,7 @@ static CBlockIndex* FindMostWorkChain() {
setBlockIndexValid.erase(pindexFailed);
pindexFailed = pindexFailed->pprev;
}
+ setBlockIndexValid.erase(pindexTest);
fInvalidAncestor = true;
break;
}