25 static const double SIGCHECK_VERIFICATION_FACTOR = 5.0;
36 MapCheckpoints::const_iterator i = checkpoints.find(nHeight);
38 if (i == checkpoints.end())
return !fMatchesCheckpoint;
39 return hash == i->second;
45 if (pindex ==
nullptr)
48 int64_t nNow = time(
nullptr);
50 double fSigcheckVerificationFactor = fSigchecks ? SIGCHECK_VERIFICATION_FACTOR : 1.0;
51 double fWorkBefore = 0.0;
52 double fWorkAfter = 0.0;
59 double nCheapBefore = pindex->
nChainTx;
62 fWorkBefore = nCheapBefore;
63 fWorkAfter = nCheapAfter + nExpensiveAfter * fSigcheckVerificationFactor;
68 fWorkBefore = nCheapBefore + nExpensiveBefore * fSigcheckVerificationFactor;
69 fWorkAfter = nExpensiveAfter * fSigcheckVerificationFactor;
72 return fWorkBefore / (fWorkBefore + fWorkAfter);
82 return checkpoints.rbegin()->first;
const CChainParams & Params()
Return the currently selected parameters.
std::map< int, uint256 > MapCheckpoints
The block chain is a tree shaped structure starting with the genesis block at the root,...
int64_t GetBlockTime() const
unsigned int nChainTx
(memory only) Number of transactions in the chain up to and including this block.
virtual const CCheckpointData & Checkpoints() const =0
Block-chain checkpoints are compiled-in sanity checks.
bool CheckBlock(int nHeight, const uint256 &hash, bool fMatchesCheckpoint)
Returns true if block passes checkpoint checks.
int GetTotalBlocksEstimate()
Return conservative estimate of total number of blocks, 0 if unknown.
double GuessVerificationProgress(const CBlockIndex *pindex, bool fSigchecks)
Guess how far we are in the verification process at the given block index.
double fTransactionsPerDay
int64_t nTransactionsLastCheckpoint
int64_t nTimeLastCheckpoint
const MapCheckpoints * mapCheckpoints