Skip to content

Commit 972714c

Browse files
dcousensNicolasDorier
authored andcommitted
pow: GetNextWorkRequired never called with NULL pindexLast
1 parent cc44c8f commit 972714c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/pow.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,9 @@
1212

1313
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)
1414
{
15+
assert(pindexLast != NULL);
1516
unsigned int nProofOfWorkLimit = UintToArith256(params.powLimit).GetCompact();
1617

17-
// Genesis block
18-
if (pindexLast == NULL)
19-
return nProofOfWorkLimit;
20-
2118
// Only change once per difficulty adjustment interval
2219
if ((pindexLast->nHeight+1) % params.DifficultyAdjustmentInterval() != 0)
2320
{

0 commit comments

Comments
 (0)