node::UpdateTime

Update a block header's time field and return the new time.

Synopsis

Declared in <node/miner.h>

int64_t
UpdateTime(
    CBlockHeader* pblock,
    Consensus::Params const& consensusParams,
    CBlockIndex const* pindexPrev);

Return Value

The updated block time.

Parameters

NameDescription
pblockThe block header to update.
consensusParamsConsensus parameters used to bound the time.
pindexPrevThe previous block the header builds on.