diff options
| author | Wladimir J. van der Laan <[email protected]> | 2015-06-10 10:29:44 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-06-10 10:33:12 +0200 |
| commit | 8d9f0a60698e951ab1070432230c14e6fcbbfbf4 (patch) | |
| tree | 0c93804bef5e2c7c130abb8e831209519ef03122 /src/chain.cpp | |
| parent | Merge pull request #6222 (diff) | |
| parent | Reduce checkpoints' effect on consensus. (diff) | |
| download | discoin-8d9f0a60698e951ab1070432230c14e6fcbbfbf4.tar.xz discoin-8d9f0a60698e951ab1070432230c14e6fcbbfbf4.zip | |
Merge pull request #5927
dce8360 Reduce checkpoints' effect on consensus. (Pieter Wuille)
Diffstat (limited to 'src/chain.cpp')
| -rw-r--r-- | src/chain.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/chain.cpp b/src/chain.cpp index 719256106..5b8ce076c 100644 --- a/src/chain.cpp +++ b/src/chain.cpp @@ -82,9 +82,10 @@ CBlockIndex* CBlockIndex::GetAncestor(int height) while (heightWalk > height) { int heightSkip = GetSkipHeight(heightWalk); int heightSkipPrev = GetSkipHeight(heightWalk - 1); - if (heightSkip == height || - (heightSkip > height && !(heightSkipPrev < heightSkip - 2 && - heightSkipPrev >= height))) { + if (pindexWalk->pskip != NULL && + (heightSkip == height || + (heightSkip > height && !(heightSkipPrev < heightSkip - 2 && + heightSkipPrev >= height)))) { // Only follow pskip if pprev->pskip isn't better than pskip->pprev. pindexWalk = pindexWalk->pskip; heightWalk = heightSkip; |