| 38 | uint64_t nLastBlockWeight = 0; |
| 39 | |
| 40 | int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev) |
| 41 | { |
| 42 | int64_t nOldTime = pblock->nTime; |
| 43 | int64_t nNewTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); |
| 44 | |
| 45 | if (nOldTime < nNewTime) |
| 46 | pblock->nTime = nNewTime; |
| 47 | |
| 48 | // Updating time can change work required on testnet: |
| 49 | if (consensusParams.fPowAllowMinDifficultyBlocks) |
| 50 | pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, consensusParams); |
| 51 | |
| 52 | return nNewTime - nOldTime; |
| 53 | } |
| 54 | |
| 55 | BlockAssembler::Options::Options() { |
| 56 | blockMinFeeRate = CFeeRate(DEFAULT_BLOCK_MIN_TX_FEE); |
no test coverage detected