diff options
| author | Jeff Garzik <[email protected]> | 2013-05-24 11:10:53 -0400 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2013-05-24 11:10:53 -0400 |
| commit | f0d8a52cc039cda77730047db2443fbec016f852 (patch) | |
| tree | 9ee293b71d88c4b2b2e34ad49b5248b9bde9d97e /src/checkpoints.cpp | |
| parent | doc/README was replaced by README.md (diff) | |
| download | discoin-f0d8a52cc039cda77730047db2443fbec016f852.tar.xz discoin-f0d8a52cc039cda77730047db2443fbec016f852.zip | |
Replace repeated GetBoolArg() calls with Checkpoint::fEnabled variable
set once at init time.
Diffstat (limited to 'src/checkpoints.cpp')
| -rw-r--r-- | src/checkpoints.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 9e8e0f702..7643ec5df 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -28,6 +28,8 @@ namespace Checkpoints double fTransactionsPerDay; }; + bool fEnabled = true; + // What makes a good checkpoint block? // + Is surrounded by blocks with reasonable timestamps // (no blocks before with a timestamp after, none after with @@ -74,7 +76,7 @@ namespace Checkpoints bool CheckBlock(int nHeight, const uint256& hash) { - if (!GetBoolArg("-checkpoints", true)) + if (!fEnabled) return true; const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints; @@ -117,7 +119,7 @@ namespace Checkpoints int GetTotalBlocksEstimate() { - if (!GetBoolArg("-checkpoints", true)) + if (!fEnabled) return 0; const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints; @@ -127,7 +129,7 @@ namespace Checkpoints CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex) { - if (!GetBoolArg("-checkpoints", true)) + if (!fEnabled) return NULL; const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints; |