Browse Source

pow: GetNextWorkRequired never called with NULL pindexLast

pull/1/head
Daniel Cousens 6 years ago committed by NicolasDorier
parent
commit
972714c956
  1. 5
      src/pow.cpp

5
src/pow.cpp

@ -12,12 +12,9 @@ @@ -12,12 +12,9 @@
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)
{
assert(pindexLast != NULL);
unsigned int nProofOfWorkLimit = UintToArith256(params.powLimit).GetCompact();
// Genesis block
if (pindexLast == NULL)
return nProofOfWorkLimit;
// Only change once per difficulty adjustment interval
if ((pindexLast->nHeight+1) % params.DifficultyAdjustmentInterval() != 0)
{

Loading…
Cancel
Save