 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
16 #include <boost/foreach.hpp>
27 static const double SIGCHECK_VERIFICATION_FACTOR = 5.0;
38 MapCheckpoints::const_iterator i = checkpoints.find(nHeight);
40 if (i == checkpoints.end())
return !fMatchesCheckpoint;
41 return hash == i->second;
50 int64_t nNow = time(NULL);
52 double fSigcheckVerificationFactor = fSigchecks ? SIGCHECK_VERIFICATION_FACTOR : 1.0;
53 double fWorkBefore = 0.0;
54 double fWorkAfter = 0.0;
61 double nCheapBefore = pindex->
nChainTx;
64 fWorkBefore = nCheapBefore;
65 fWorkAfter = nCheapAfter + nExpensiveAfter * fSigcheckVerificationFactor;
70 fWorkBefore = nCheapBefore + nExpensiveBefore * fSigcheckVerificationFactor;
71 fWorkAfter = nExpensiveAfter * fSigcheckVerificationFactor;
74 return fWorkBefore / (fWorkBefore + fWorkAfter);
84 return checkpoints.rbegin()->first;
94 BOOST_REVERSE_FOREACH (
const MapCheckpoints::value_type& i, checkpoints) {
int64_t GetBlockTime() const
int GetTotalBlocksEstimate()
Return conservative estimate of total number of blocks, 0 if unknown.
int64_t nTransactionsLastCheckpoint
unsigned int nChainTx
(memory only) Number of transactions in the chain up to and including this block.
CBlockIndex * GetLastCheckpoint()
Returns last CBlockIndex* in mapBlockIndex that is a checkpoint.
virtual const Checkpoints::CCheckpointData & Checkpoints() const =0
const MapCheckpoints * mapCheckpoints
Block-chain checkpoints are compiled-in sanity checks.
std::map< int, uint256 > MapCheckpoints
256-bit unsigned big integer.
bool CheckBlock(int nHeight, const uint256 &hash, bool fMatchesCheckpoint)
Returns true if block passes checkpoint checks.
double GuessVerificationProgress(const CBlockIndex *pindex, bool fSigchecks)
Guess how far we are in the verification process at the given block index.
double fTransactionsPerDay
const CChainParams & Params()
Return the currently selected parameters.
int64_t nTimeLastCheckpoint
The block chain is a tree shaped structure starting with the genesis block at the root,...