aboutsummaryrefslogtreecommitdiff
path: root/src/checkpoints.cpp
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2015-04-22 23:22:36 -0400
committerCory Fields <cory-nospam-@coryfields.com>2015-04-30 23:14:48 -0400
commita8cdaf5c962ff9018e2d8411f532eec7355f0623 (patch)
treec98c3ebb907548099b601a76f0dbeb99fb3af084 /src/checkpoints.cpp
parent11982d366df0301b8ceb6e9ec5bdc5a713be9ff0 (diff)
checkpoints: move the checkpoints enable boolean into main
This pertains to app-state, so it doesn't make sense to handle inside the checkpoint functions.
Diffstat (limited to 'src/checkpoints.cpp')
-rw-r--r--src/checkpoints.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp
index 3780899632..ddbf38efba 100644
--- a/src/checkpoints.cpp
+++ b/src/checkpoints.cpp
@@ -23,13 +23,8 @@ namespace Checkpoints {
*/
static const double SIGCHECK_VERIFICATION_FACTOR = 5.0;
- bool fEnabled = true;
-
bool CheckBlock(const CCheckpointData& data, int nHeight, const uint256& hash)
{
- if (!fEnabled)
- return true;
-
const MapCheckpoints& checkpoints = data.mapCheckpoints;
MapCheckpoints::const_iterator i = checkpoints.find(nHeight);
@@ -69,19 +64,16 @@ namespace Checkpoints {
int GetTotalBlocksEstimate(const CCheckpointData& data)
{
- if (!fEnabled)
- return 0;
-
const MapCheckpoints& checkpoints = data.mapCheckpoints;
+ if (checkpoints.empty())
+ return 0;
+
return checkpoints.rbegin()->first;
}
CBlockIndex* GetLastCheckpoint(const CCheckpointData& data)
{
- if (!fEnabled)
- return NULL;
-
const MapCheckpoints& checkpoints = data.mapCheckpoints;
BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints)