6 #include <boost/assign/list_of.hpp>
7 #include <boost/foreach.hpp>
23 static const double fSigcheckVerificationFactor = 5.0;
37 static MapCheckpoints mapCheckpoints =
38 boost::assign::map_list_of
39 ( 1,
uint256(
"0xfdbe99b90c90bae7505796461471d89ae8388ab953997aa06a355bbda8d915cb"))
40 ( 22267,
uint256(
"0x23dc7d871fc2a9b994112e978019f6370bab0b8979f557afe77a7ab620224b70"))
41 ( 22847,
uint256(
"0x1450b80c150fee1e657ee8309819276342c021fab5e6a20ccf5407f5e2218d0f"))
42 ( 23453,
uint256(
"0x7c25d3f9671e1d9400c9a1be2ff68e68db561ab85ae6b7020062d8d26da81e4c"))
43 ( 28230,
uint256(
"0xd3feb71f92c63c682f994d7c615adc425226c669a83d46012b32fc8d518b08bb"))
44 ( 31846,
uint256(
"0xba7d5c0e6d46f6448253290ce037e13975c13ca9c375ae854b6b2f85044fc0f9"))
45 ( 33918,
uint256(
"0x023cf4acfd8bf0114090a7ce048e79ac28152de78bb41f1277742904494e6c49"))
46 ( 34000,
uint256(
"0x082f5d9023af3f068733ab68cf81b741f58e3c75ae28d2a9bd07f30b74c38356"))
47 ( 41300,
uint256(
"0x8c4e02f6c0d20e856fd7e952a147fee30ce145ca6932a284f354924362d2b408"))
69 MapCheckpoints::const_iterator i = checkpoints.find(nHeight);
70 if (i == checkpoints.end())
return true;
71 return hash == i->second;
79 int64 nNow = time(NULL);
81 double fWorkBefore = 0.0;
82 double fWorkAfter = 0.0;
89 double nCheapBefore = pindex->
nChainTx;
92 fWorkBefore = nCheapBefore;
93 fWorkAfter = nCheapAfter + nExpensiveAfter*fSigcheckVerificationFactor;
98 fWorkBefore = nCheapBefore + nExpensiveBefore*fSigcheckVerificationFactor;
99 fWorkAfter = nExpensiveAfter*fSigcheckVerificationFactor;
102 return fWorkBefore / (fWorkBefore + fWorkAfter);
113 return checkpoints.rbegin()->first;
124 BOOST_REVERSE_FOREACH(
const MapCheckpoints::value_type& i, checkpoints)
127 std::map<uint256, CBlockIndex*>::const_iterator t = mapBlockIndex.find(hash);
128 if (t != mapBlockIndex.end())
137 return (checkpoints.rbegin()->second);
CBlockIndex * GetLastCheckpoint(const std::map< uint256, CBlockIndex * > &mapBlockIndex)
int64 nTransactionsLastCheckpoint
std::map< int, uint256 > MapCheckpoints
const MapCheckpoints * mapCheckpoints
Block-chain checkpoints are compiled-in sanity checks.
bool GetBoolArg(const std::string &strArg, bool fDefault)
Return boolean argument or default value.
int64 nTimeLastCheckpoint
const CCheckpointData & Checkpoints()
int GetTotalBlocksEstimate()
bool CheckBlock(int nHeight, const uint256 &hash)
uint256 GetLatestHardenedCheckpoint()
double fTransactionsPerDay
The block chain is a tree shaped structure starting with the genesis block at the root...
map< uint256, CBlockIndex * > mapBlockIndex
double GuessVerificationProgress(CBlockIndex *pindex)