diff options
| author | Daniel Cousens <[email protected]> | 2016-09-05 17:08:57 +1000 |
|---|---|---|
| committer | NicolasDorier <[email protected]> | 2017-02-15 22:11:29 +0900 |
| commit | 972714c95687eda3afc209d62e0ed32fd50eef31 (patch) | |
| tree | d9cbf24111281b84a5305345aee6eddd121d0f09 /src/pow.cpp | |
| parent | ContextualCheckBlockHeader should never have pindexPrev to NULL (diff) | |
| download | discoin-972714c95687eda3afc209d62e0ed32fd50eef31.tar.xz discoin-972714c95687eda3afc209d62e0ed32fd50eef31.zip | |
pow: GetNextWorkRequired never called with NULL pindexLast
Diffstat (limited to 'src/pow.cpp')
| -rw-r--r-- | src/pow.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/pow.cpp b/src/pow.cpp index e57fd866f..e06d9662e 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) { |