MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetMinimumTime

Function GetMinimumTime

src/node/miner.cpp:57–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55namespace node {
56
57int64_t GetMinimumTime(const CBlockIndex* pindexPrev, const int64_t difficulty_adjustment_interval)
58{
59 int64_t min_time{pindexPrev->GetMedianTimePast() + 1};
60 // Height of block to be mined.
61 const int height{pindexPrev->nHeight + 1};
62 // Account for BIP94 timewarp rule on all networks. This makes future
63 // activation safer.
64 if (height % difficulty_adjustment_interval == 0) {
65 min_time = std::max<int64_t>(min_time, pindexPrev->GetBlockTime() - MAX_TIMEWARP);
66 }
67 return min_time;
68}
69
70int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev)
71{

Callers 2

getblocktemplateFunction · 0.85
UpdateTimeFunction · 0.85

Calls 2

GetMedianTimePastMethod · 0.80
GetBlockTimeMethod · 0.45

Tested by

no test coverage detected