aboutsummaryrefslogtreecommitdiff
path: root/src/pow.cpp
diff options
context:
space:
mode:
authorDaniel Cousens <dcousens@users.noreply.github.com>2016-09-05 17:08:57 +1000
committerNicolasDorier <nicolas.dorier@gmail.com>2017-02-15 22:11:29 +0900
commit972714c95687eda3afc209d62e0ed32fd50eef31 (patch)
treed9cbf24111281b84a5305345aee6eddd121d0f09 /src/pow.cpp
parentcc44c8f143e9ce6e10aeed2f6faf2ca589e910a4 (diff)
pow: GetNextWorkRequired never called with NULL pindexLast
Diffstat (limited to 'src/pow.cpp')
-rw-r--r--src/pow.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/pow.cpp b/src/pow.cpp
index e57fd866f8..e06d9662e6 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)
{