|
|
@ -39,6 +39,9 @@ namespace Checkpoints |
|
|
|
|
|
|
|
|
|
|
|
bool CheckBlock(int nHeight, const uint256& hash) |
|
|
|
bool CheckBlock(int nHeight, const uint256& hash) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (!GetBoolArg("-checkpoints", true)) |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints); |
|
|
|
MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints); |
|
|
|
|
|
|
|
|
|
|
|
MapCheckpoints::const_iterator i = checkpoints.find(nHeight); |
|
|
|
MapCheckpoints::const_iterator i = checkpoints.find(nHeight); |
|
|
@ -48,6 +51,9 @@ namespace Checkpoints |
|
|
|
|
|
|
|
|
|
|
|
int GetTotalBlocksEstimate() |
|
|
|
int GetTotalBlocksEstimate() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (!GetBoolArg("-checkpoints", true)) |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
|
|
MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints); |
|
|
|
MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints); |
|
|
|
|
|
|
|
|
|
|
|
return checkpoints.rbegin()->first; |
|
|
|
return checkpoints.rbegin()->first; |
|
|
@ -55,6 +61,9 @@ namespace Checkpoints |
|
|
|
|
|
|
|
|
|
|
|
CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex) |
|
|
|
CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (!GetBoolArg("-checkpoints", true)) |
|
|
|
|
|
|
|
return NULL; |
|
|
|
|
|
|
|
|
|
|
|
MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints); |
|
|
|
MapCheckpoints& checkpoints = (fTestNet ? mapCheckpointsTestnet : mapCheckpoints); |
|
|
|
|
|
|
|
|
|
|
|
BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints) |
|
|
|
BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints) |
|
|
|