mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-23 13:24:18 +00:00
pow: GetNextWorkRequired never called with NULL pindexLast
This commit is contained in:
parent
cc44c8f143
commit
972714c956
@ -12,12 +12,9 @@
|
|||||||
|
|
||||||
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)
|
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)
|
||||||
{
|
{
|
||||||
|
assert(pindexLast != NULL);
|
||||||
unsigned int nProofOfWorkLimit = UintToArith256(params.powLimit).GetCompact();
|
unsigned int nProofOfWorkLimit = UintToArith256(params.powLimit).GetCompact();
|
||||||
|
|
||||||
// Genesis block
|
|
||||||
if (pindexLast == NULL)
|
|
||||||
return nProofOfWorkLimit;
|
|
||||||
|
|
||||||
// Only change once per difficulty adjustment interval
|
// Only change once per difficulty adjustment interval
|
||||||
if ((pindexLast->nHeight+1) % params.DifficultyAdjustmentInterval() != 0)
|
if ((pindexLast->nHeight+1) % params.DifficultyAdjustmentInterval() != 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user