aboutsummaryrefslogtreecommitdiff
path: root/src/checkpoints.cpp
diff options
context:
space:
mode:
authorJeff Garzik <[email protected]>2013-05-30 07:44:42 -0700
committerJeff Garzik <[email protected]>2013-05-30 07:44:42 -0700
commit1803fa1db995e61258f1542e1766aec5b104d87d (patch)
tree94a295f22e1ba1ccfd6b984d89c3722d1719e482 /src/checkpoints.cpp
parentMerge pull request #2104 from al42and/listreceivedbyaddress_txids (diff)
parentReplace repeated GetBoolArg() calls with Checkpoint::fEnabled variable (diff)
downloaddiscoin-1803fa1db995e61258f1542e1766aec5b104d87d.tar.xz
discoin-1803fa1db995e61258f1542e1766aec5b104d87d.zip
Merge pull request #2693 from jgarzik/checkpoint-bool
Replace repeated GetBoolArg() calls with Checkpoint::fEnabled variable set once at init time
Diffstat (limited to 'src/checkpoints.cpp')
-rw-r--r--src/checkpoints.cpp8
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;