1 // Copyright (c) 2009-2014 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef BITCOIN_CHECKPOINTS_H
6 #define BITCOIN_CHECKPOINTS_H
15 * Block-chain checkpoints are compiled-in sanity checks.
16 * They are updated every release or three.
20 typedef std::map<int, uint256> MapCheckpoints;
22 struct CCheckpointData {
23 MapCheckpoints mapCheckpoints;
24 int64_t nTimeLastCheckpoint;
25 int64_t nTransactionsLastCheckpoint;
26 double fTransactionsPerDay;
29 //! Returns true if block passes checkpoint checks
30 bool CheckBlock(const CCheckpointData& data, int nHeight, const uint256& hash);
32 //! Return conservative estimate of total number of blocks, 0 if unknown
33 int GetTotalBlocksEstimate(const CCheckpointData& data);
35 //! Returns last CBlockIndex* in mapBlockIndex that is a checkpoint
36 CBlockIndex* GetLastCheckpoint(const CCheckpointData& data);
38 double GuessVerificationProgress(const CCheckpointData& data, CBlockIndex* pindex, bool fSigchecks = true);
40 } //namespace Checkpoints
42 #endif // BITCOIN_CHECKPOINTS_H