aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-12-12 09:18:00 -0800
committerGavin Andresen <gavinandresen@gmail.com>2012-12-12 09:18:00 -0800
commita9e055a1cabc07fc43ef8e9e3b2fc0fbb41fd2ef (patch)
treeb568d6d7b2023254e153135d5a3776c125ba2d1d /src
parent78504bb04ffe77ac156aaa5f863424deaaa3ca0f (diff)
parente6955d04111e842cce55dc230d9dcc971560a299 (diff)
Merge pull request #2048 from jgarzik/no-checkpoints
Add "checkpoints" option, to permit disabling of checkpoint logic.
Diffstat (limited to 'src')
-rw-r--r--src/checkpoints.cpp9
-rw-r--r--src/init.cpp1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp
index 8208854962..279003072e 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", true))
+ 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", true))
+ return 0;
+
MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints);
return checkpoints.rbegin()->first;
@@ -55,6 +61,9 @@ namespace Checkpoints
CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex)
{
+ if (!GetBoolArg("-checkpoints", true))
+ return NULL;
+
MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints);
BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints)
diff --git a/src/init.cpp b/src/init.cpp
index 9735c2780b..7f311fa881 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -258,6 +258,7 @@ std::string HelpMessage()
" -onlynet=<net> " + _("Only connect to nodes in network <net> (IPv4, IPv6 or Tor)") + "\n" +
" -discover " + _("Discover own IP address (default: 1 when listening and no -externalip)") + "\n" +
" -irc " + _("Find peers using internet relay chat (default: 0)") + "\n" +
+ " -checkpoints " + _("Lock in block chain with compiled-in checkpoints (default: 1)") + "\n" +
" -listen " + _("Accept connections from outside (default: 1 if no -proxy or -connect)") + "\n" +
" -bind=<addr> " + _("Bind to given address and always listen on it. Use [host]:port notation for IPv6") + "\n" +
" -dnsseed " + _("Find peers using DNS lookup (default: 1 unless -connect)") + "\n" +