From 2feb321c2e87e9ac5e6ff510c729042f633a0daf Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 11 Oct 2016 01:11:20 +0400 Subject: [PATCH] IsBlockchainSynced should not proceed until we are past the latest checkpoint (#1070) --- src/masternode-sync.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index 53eb0e84b..ebf1503b0 100644 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "activemasternode.h" +#include "checkpoints.h" #include "governance.h" #include "main.h" #include "masternode.h" @@ -30,6 +31,8 @@ bool CMasternodeSync::IsBlockchainSynced() if(fBlockchainSynced) return true; if(!pCurrentBlockIndex || !pindexBestHeader || fImporting || fReindex) return false; + if(fCheckpointsEnabled && pCurrentBlockIndex->nHeight < Checkpoints::GetTotalBlocksEstimate(Params().Checkpoints())) + return false; // same as !IsInitialBlockDownload() but no cs_main needed here int nMaxBlockTime = std::max(pCurrentBlockIndex->GetBlockTime(), pindexBestHeader->GetBlockTime());