From 972714c95687eda3afc209d62e0ed32fd50eef31 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Mon, 5 Sep 2016 17:08:57 +1000 Subject: [PATCH] pow: GetNextWorkRequired never called with NULL pindexLast --- src/pow.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/pow.cpp b/src/pow.cpp index e57fd866f8a..e06d9662e6b 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -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) {