13 #include <boost/assign/list_of.hpp>
14 #include <boost/foreach.hpp>
25 static const double SIGCHECK_VERIFICATION_FACTOR = 5.0;
41 static MapCheckpoints mapCheckpoints =
42 boost::assign::map_list_of
43 ( 1,
uint256(
"0x8fe2901fc0999bc86ea2668c58802ee87165438166d18154f1bd4f917bf25e0f"))
44 ( 7,
uint256(
"0x4530df06d98fc77d04dab427630fc63b45f10d2b0ad3ad3a651883938986d629"))
45 ( 7777,
uint256(
"0xae3094030b34a422c44b9832c84fe602d0d528449d6940374bd43b4472b4df5e"))
46 (15420,
uint256(
"0xfded6a374d071f59d738a3009fc4d8461609052c3e7e91aa89146550d179c1b0"))
47 (16000,
uint256(
"0x683517a8cae8530f39e636f010ecd1750665c3d91f57ba71d6556535972ab328"))
48 (77777,
uint256(
"0xf5c98062cb1ad75c792a1851a388447f0edd7cb2271b67ef1241a03c673b7735"))
49 (77778,
uint256(
"0xd13f93f9fdac82ea26ed8f90474ed2449c8c24be50a416e43c323a38573c30e5"))
50 (100000,
uint256(
"0xcc4f0b11e9e17f7a406ac4a71e6e192b9b43e32b300ddecba229c789392497eb"))
51 (125000,
uint256(
"0x52a933553dda61b4af6a418f10ce563f0c84df93619ec97f8f360f9ecc51cf5b"))
52 (150000,
uint256(
"0xb1dc241da3e8e7d4ca2df75187d66f4f096840634667b987a7b60d5dde92853c"))
53 (210000,
uint256(
"0xb9c2c5030199a87cb99255551b7f67bff6adf3ef2caf97258b93b417d14f9051"))
63 static MapCheckpoints mapCheckpointsTestnet =
64 boost::assign::map_list_of
65 ( 546,
uint256(
"0xa0fea99a6897f531600c8ae53367b126824fd6a847b2b2b73817a95b8e27e602"))
67 static const CCheckpointData dataTestnet = {
68 &mapCheckpointsTestnet,
74 static MapCheckpoints mapCheckpointsRegtest =
75 boost::assign::map_list_of
76 ( 0,
uint256(
"0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"))
78 static const CCheckpointData dataRegtest = {
79 &mapCheckpointsRegtest,
101 MapCheckpoints::const_iterator i = checkpoints.find(nHeight);
102 if (i == checkpoints.end())
return true;
103 return hash == i->second;
111 int64_t nNow = time(NULL);
113 double fSigcheckVerificationFactor = fSigchecks ? SIGCHECK_VERIFICATION_FACTOR : 1.0;
114 double fWorkBefore = 0.0;
115 double fWorkAfter = 0.0;
122 double nCheapBefore = pindex->
nChainTx;
125 fWorkBefore = nCheapBefore;
126 fWorkAfter = nCheapAfter + nExpensiveAfter*fSigcheckVerificationFactor;
131 fWorkBefore = nCheapBefore + nExpensiveBefore*fSigcheckVerificationFactor;
132 fWorkAfter = nExpensiveAfter*fSigcheckVerificationFactor;
135 return fWorkBefore / (fWorkBefore + fWorkAfter);
145 return checkpoints.rbegin()->first;
155 BOOST_REVERSE_FOREACH(
const MapCheckpoints::value_type& i, checkpoints)
157 const uint256& hash = i.second;
158 std::map<uint256, CBlockIndex*>::const_iterator t = mapBlockIndex.find(hash);
159 if (t != mapBlockIndex.end())
int64_t nTransactionsLastCheckpoint
CBlockIndex * GetLastCheckpoint(const std::map< uint256, CBlockIndex * > &mapBlockIndex)
std::map< int, uint256 > MapCheckpoints
const MapCheckpoints * mapCheckpoints
Block-chain checkpoints are compiled-in sanity checks.
const CCheckpointData & Checkpoints()
int GetTotalBlocksEstimate()
bool CheckBlock(int nHeight, const uint256 &hash)
double GuessVerificationProgress(CBlockIndex *pindex, bool fSigchecks)
double fTransactionsPerDay
The block chain is a tree shaped structure starting with the genesis block at the root...
const CChainParams & Params()
Return the currently selected parameters.
int64_t nTimeLastCheckpoint
map< uint256, CBlockIndex * > mapBlockIndex