Changeset View
Changeset View
Standalone View
Standalone View
src/pow.cpp
Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | uint32_t GetNextWorkRequired(const CBlockIndex *pindexPrev, | ||||
// GetNextWorkRequired should never be called on the genesis block | // GetNextWorkRequired should never be called on the genesis block | ||||
assert(pindexPrev != nullptr); | assert(pindexPrev != nullptr); | ||||
// Special rule for regtest: we never retarget. | // Special rule for regtest: we never retarget. | ||||
if (params.fPowNoRetargeting) { | if (params.fPowNoRetargeting) { | ||||
return pindexPrev->nBits; | return pindexPrev->nBits; | ||||
} | } | ||||
if (IsDAAEnabled(config, pindexPrev)) { | if (IsDAAEnabled(params, pindexPrev)) { | ||||
return GetNextCashWorkRequired(pindexPrev, pblock, config); | return GetNextCashWorkRequired(pindexPrev, pblock, config); | ||||
} | } | ||||
return GetNextEDAWorkRequired(pindexPrev, pblock, config); | return GetNextEDAWorkRequired(pindexPrev, pblock, config); | ||||
} | } | ||||
uint32_t CalculateNextWorkRequired(const CBlockIndex *pindexPrev, | uint32_t CalculateNextWorkRequired(const CBlockIndex *pindexPrev, | ||||
int64_t nFirstBlockTime, | int64_t nFirstBlockTime, | ||||
▲ Show 20 Lines • Show All 173 Lines • Show Last 20 Lines |