From 2d28ad9c6f57360f0596b2b2ef2ef5994d0f6dfe Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 27 Jun 2018 07:08:30 -1100 Subject: [PATCH] Tweak height 1 fix --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c6272cc35..2d83ac89d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4060,11 +4060,11 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta // Don't accept any forks from the main chain prior to last checkpoint CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(chainParams.Checkpoints()); int32_t notarized_height; - if ( pcheckpoint && nHeight > 1 ) + if ( nHeight > 1 ) { - if (nHeight < pcheckpoint->nHeight ) + if ( pcheckpoint != 0 && nHeight < pcheckpoint->nHeight ) return state.DoS(1, error("%s: forked chain older than last checkpoint (height %d) vs %d", __func__, nHeight,pcheckpoint->nHeight)); - else if ( komodo_checkpoint(¬arized_height,nHeight,hash) < 0 ) + if ( komodo_checkpoint(¬arized_height,nHeight,hash) < 0 ) { CBlockIndex *heightblock = chainActive[nHeight]; if ( heightblock != 0 && heightblock->GetBlockHash() == hash )