| 135 | } |
| 136 | |
| 137 | void 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 | } |
no test coverage detected