MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / UpdateTime

Function UpdateTime

src/miner.cpp:48–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46uint64_t nLastBlockSize = 0;
47
48void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev)
49{
50 pblock->nTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime());
51
52 // Updating time can change work required on testnet:
53 if (consensusParams.fPowAllowMinDifficultyBlocks)
54 pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, consensusParams);
55}
56
57// BIP100 string:
58// - Adds our block size vote (B) if configured.

Callers 3

CreateNewBlockFunction · 0.85
BitcoinMinerFunction · 0.85
getblocktemplateFunction · 0.85

Calls 3

GetAdjustedTimeFunction · 0.85
GetNextWorkRequiredFunction · 0.85
GetMedianTimePastMethod · 0.80

Tested by

no test coverage detected