]>
Commit | Line | Data |
---|---|---|
f914f1a7 | 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers |
fa94b9d5 | 2 | // Distributed under the MIT software license, see the accompanying |
bc909a7a | 3 | // file COPYING or https://www.opensource.org/licenses/mit-license.php . |
51ed9ec9 | 4 | |
84738627 PJ |
5 | #ifndef BITCOIN_CHECKPOINTS_H |
6 | #define BITCOIN_CHECKPOINTS_H | |
eb5fff9e | 7 | |
e11712df | 8 | #include "uint256.h" |
366c88dc | 9 | #include "chainparams.h" |
e11712df | 10 | |
10fd7f66 | 11 | #include <map> |
10fd7f66 | 12 | |
10fd7f66 | 13 | class CBlockIndex; |
47b71cec | 14 | struct CCheckpointData; |
eb5fff9e | 15 | |
7e6d23b1 | 16 | /** |
fa94b9d5 | 17 | * Block-chain checkpoints are compiled-in sanity checks. |
6b8de05d PW |
18 | * They are updated every release or three. |
19 | */ | |
20e01b1a PW |
20 | namespace Checkpoints |
21 | { | |
e11712df | 22 | |
9000990c | 23 | typedef std::map<int, uint256> MapCheckpoints; |
e11712df | 24 | |
b929c085 | 25 | struct CCheckpointData { |
c0d53a6e | 26 | MapCheckpoints mapCheckpoints; |
27 | int64_t nTimeLastCheckpoint; | |
28 | int64_t nTransactionsLastCheckpoint; | |
29 | double fTransactionsPerDay; | |
b929c085 | 30 | }; |
9f8c7135 | 31 | bool CheckBlock(const CChainParams::CCheckpointData& data, int nHeight, const uint256& hash); |
e11712df | 32 | |
9000990c | 33 | |
b2a98c42 | 34 | //! Return conservative estimate of total number of blocks, 0 if unknown |
efd0823e | 35 | int GetTotalBlocksEstimate(const CChainParams::CCheckpointData& data); |
eb5fff9e | 36 | |
b2a98c42 | 37 | //! Returns last CBlockIndex* in mapBlockIndex that is a checkpoint |
efd0823e | 38 | CBlockIndex* GetLastCheckpoint(const CChainParams::CCheckpointData& data); |
10fd7f66 | 39 | |
2d9aa109 | 40 | double GuessVerificationProgress(const CChainParams::CCheckpointData& data, CBlockIndex* pindex, bool fSigchecks = true); |
e10dcf27 PK |
41 | |
42 | } //namespace Checkpoints | |
eb5fff9e | 43 | |
84738627 | 44 | #endif // BITCOIN_CHECKPOINTS_H |