From 8d24a59810b26177542c12c397ece64cc5597d9d Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 20 Aug 2013 02:05:14 +0400 Subject: [PATCH] Do not display sync-checkpoint related warnings if -nosynccheckpoints option is set. --- src/main.cpp | 24 ++++++++---------------- 1 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b3e7223..992e189 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2279,18 +2279,9 @@ bool CBlock::AcceptBlock() if (!Checkpoints::CheckHardened(nHeight, hash)) return DoS(100, error("AcceptBlock() : rejected by hardened checkpoint lock-in at %d", nHeight)); - // ppcoin: check that the block satisfies synchronized checkpoint - if (!Checkpoints::CheckSync(hash, pindexPrev)) - { - if(!GetBoolArg("-nosynccheckpoints", false)) - { - return error("AcceptBlock() : rejected by synchronized checkpoint"); - } - else - { - strMiscWarning = _("WARNING: syncronized checkpoint violation detected, but skipped!"); - } - } + // Check that the block satisfies synchronized checkpoint + if (!GetBoolArg("-nosynccheckpoints", false) && !Checkpoints::CheckSync(hash, pindexPrev)) + return error("AcceptBlock() : rejected by synchronized checkpoint"); // Enforce rule that the coinbase starts with serialized block height CScript expect = CScript() << nHeight; @@ -3001,9 +2992,10 @@ string GetWarnings(string strFor) strStatusBar = strMiscWarning; } - // ppcoin: should not enter safe mode for longer invalid chain - // ppcoin: if sync-checkpoint is too old do not enter safe mode - if (Checkpoints::IsSyncCheckpointTooOld(60 * 60 * 24 * 10) && !fTestNet && !IsInitialBlockDownload()) + // * Should not enter safe mode for longer invalid chain + // * If sync-checkpoint is too old do not enter safe mode + // * Do not display warning if -nosynccheckpoints specified + if (!GetBoolArg("-nosynccheckpoints", false) && Checkpoints::IsSyncCheckpointTooOld(60 * 60 * 24 * 10) && !fTestNet && !IsInitialBlockDownload()) { nPriority = 100; strStatusBar = "WARNING: Checkpoint is too old. Wait for block chain to download, or notify developers."; @@ -3027,7 +3019,7 @@ string GetWarnings(string strFor) nPriority = alert.nPriority; strStatusBar = alert.strStatusBar; if (nPriority > 1000) - strRPC = strStatusBar; // ppcoin: safe mode for high alert + strRPC = strStatusBar; } } } -- 1.7.1