From 857b3ad923a6dccb520eca5be06fe7c0d279b9a9 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 28 Nov 2012 12:07:42 -0500 Subject: Add "checkpoints" option, to permit disabling of checkpoint logic. --- src/checkpoints.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/checkpoints.cpp') diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 820885496..cf3980561 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -39,6 +39,9 @@ namespace Checkpoints bool CheckBlock(int nHeight, const uint256& hash) { + if (!GetBoolArg("-checkpoints", false)) + return true; + MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints); MapCheckpoints::const_iterator i = checkpoints.find(nHeight); @@ -48,6 +51,9 @@ namespace Checkpoints int GetTotalBlocksEstimate() { + if (!GetBoolArg("-checkpoints", false)) + return 0; + MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints); return checkpoints.rbegin()->first; @@ -55,6 +61,9 @@ namespace Checkpoints CBlockIndex* GetLastCheckpoint(const std::map& mapBlockIndex) { + if (!GetBoolArg("-checkpoints", false)) + return NULL; + MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints); BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints) -- cgit v1.2.3 From e6955d04111e842cce55dc230d9dcc971560a299 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 28 Nov 2012 12:10:57 -0500 Subject: New 'checkpoints' option should default to true. --- src/checkpoints.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/checkpoints.cpp') diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index cf3980561..279003072 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -39,7 +39,7 @@ namespace Checkpoints bool CheckBlock(int nHeight, const uint256& hash) { - if (!GetBoolArg("-checkpoints", false)) + if (!GetBoolArg("-checkpoints", true)) return true; MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints); @@ -51,7 +51,7 @@ namespace Checkpoints int GetTotalBlocksEstimate() { - if (!GetBoolArg("-checkpoints", false)) + if (!GetBoolArg("-checkpoints", true)) return 0; MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints); @@ -61,7 +61,7 @@ namespace Checkpoints CBlockIndex* GetLastCheckpoint(const std::map& mapBlockIndex) { - if (!GetBoolArg("-checkpoints", false)) + if (!GetBoolArg("-checkpoints", true)) return NULL; MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints); -- cgit v1.2.3