diff options
| author | Jeff Garzik <[email protected]> | 2012-11-28 12:07:42 -0500 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2012-11-28 12:07:42 -0500 |
| commit | 857b3ad923a6dccb520eca5be06fe7c0d279b9a9 (patch) | |
| tree | 20410fdd9c8085eeecc047c9ecbb44e0b29a2d95 /src/checkpoints.cpp | |
| parent | Merge pull request #2006 from robbak/make-leveldb-macro (diff) | |
| download | discoin-857b3ad923a6dccb520eca5be06fe7c0d279b9a9.tar.xz discoin-857b3ad923a6dccb520eca5be06fe7c0d279b9a9.zip | |
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..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<uint256, CBlockIndex*>& mapBlockIndex) { + if (!GetBoolArg("-checkpoints", false)) + return NULL; + MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints); BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints) |