diff options
| author | Gavin Andresen <[email protected]> | 2012-12-12 09:18:00 -0800 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2012-12-12 09:18:00 -0800 |
| commit | a9e055a1cabc07fc43ef8e9e3b2fc0fbb41fd2ef (patch) | |
| tree | b568d6d7b2023254e153135d5a3776c125ba2d1d /src/checkpoints.cpp | |
| parent | Merge pull request #1861 from jgarzik/coinlock (diff) | |
| parent | New 'checkpoints' option should default to true. (diff) | |
| download | discoin-a9e055a1cabc07fc43ef8e9e3b2fc0fbb41fd2ef.tar.xz discoin-a9e055a1cabc07fc43ef8e9e3b2fc0fbb41fd2ef.zip | |
Merge pull request #2048 from jgarzik/no-checkpoints
Add "checkpoints" option, to permit disabling of checkpoint logic.
Diffstat (limited to 'src/checkpoints.cpp')
| -rw-r--r-- | src/checkpoints.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 820885496..279003072 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) |