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

Function NextEmptyBlockIndex

src/rpc/server_util.cpp:137–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137void NextEmptyBlockIndex(CBlockIndex& tip, const Consensus::Params& consensusParams, CBlockIndex& next_index)
138{
139 CBlockHeader next_header{};
140 next_header.hashPrevBlock = tip.GetBlockHash();
141 UpdateTime(&next_header, consensusParams, &tip);
142 next_header.nBits = GetNextWorkRequired(&tip, &next_header, consensusParams);
143 next_header.nNonce = 0;
144
145 next_index.pprev = &tip;
146 next_index.nTime = next_header.nTime;
147 next_index.nBits = next_header.nBits;
148 next_index.nNonce = next_header.nNonce;
149 next_index.nHeight = tip.nHeight + 1;
150}

Callers 1

getmininginfoFunction · 0.85

Calls 3

UpdateTimeFunction · 0.85
GetNextWorkRequiredFunction · 0.85
GetBlockHashMethod · 0.45

Tested by

no test coverage detected