| 55 | namespace node { |
| 56 | |
| 57 | int64_t GetMinimumTime(const CBlockIndex* pindexPrev, const int64_t difficulty_adjustment_interval) |
| 58 | { |
| 59 | int64_t min_time{pindexPrev->GetMedianTimePast() + 1}; |
| 60 | // Height of block to be mined. |
| 61 | const int height{pindexPrev->nHeight + 1}; |
| 62 | // Account for BIP94 timewarp rule on all networks. This makes future |
| 63 | // activation safer. |
| 64 | if (height % difficulty_adjustment_interval == 0) { |
| 65 | min_time = std::max<int64_t>(min_time, pindexPrev->GetBlockTime() - MAX_TIMEWARP); |
| 66 | } |
| 67 | return min_time; |
| 68 | } |
| 69 | |
| 70 | int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev) |
| 71 | { |
no test coverage detected