mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 15:39:05 +01:00
Add "checkpoints" option, to permit disabling of checkpoint logic.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user