]> Git Repo - VerusCoin.git/blobdiff - src/chain.cpp
Reduce checkpoints' effect on consensus.
[VerusCoin.git] / src / chain.cpp
index 719256106e08fbcd2ff2a61191760e75d622d5c8..5b8ce076c479329f63e436fdf1f5a26d3fc75296 100644 (file)
@@ -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;
This page took 0.022478 seconds and 4 git commands to generate.