Back to home page

Bitcoin sources

 
 

    


0001 // Copyright (c) 2011 The Bitcoin developers
0002 // Distributed under the MIT/X11 software license, see the accompanying
0003 // file license.txt or http://www.opensource.org/licenses/mit-license.php.
0004 #ifndef BITCOIN_CHECKPOINT_H
0005 #define  BITCOIN_CHECKPOINT_H
0006 
0007 #include <map>
0008 #include "util.h"
0009 
0010 class uint256;
0011 class CBlockIndex;
0012 
0013 //
0014 // Block-chain checkpoints are compiled-in sanity checks.
0015 // They are updated every release or three.
0016 //
0017 namespace Checkpoints
0018 {
0019     // Returns true if block passes checkpoint checks
0020     bool CheckBlock(int nHeight, const uint256& hash);
0021 
0022     // Return conservative estimate of total number of blocks, 0 if unknown
0023     int GetTotalBlocksEstimate();
0024 
0025     // Returns last CBlockIndex* in mapBlockIndex that is a checkpoint
0026     CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex);
0027 }
0028 
0029 #endif