diff options
| author | NicolasDorier <[email protected]> | 2016-09-05 15:55:04 +0900 |
|---|---|---|
| committer | NicolasDorier <[email protected]> | 2017-02-15 22:11:28 +0900 |
| commit | cc44c8f143e9ce6e10aeed2f6faf2ca589e910a4 (patch) | |
| tree | 06fb59116a47abec079c884145abec86c66301fa /src/validation.cpp | |
| parent | Merge #9108: Use importmulti timestamp when importing watch only keys (on top... (diff) | |
| download | discoin-cc44c8f143e9ce6e10aeed2f6faf2ca589e910a4.tar.xz discoin-cc44c8f143e9ce6e10aeed2f6faf2ca589e910a4.zip | |
ContextualCheckBlockHeader should never have pindexPrev to NULL
Diffstat (limited to 'src/validation.cpp')
| -rw-r--r-- | src/validation.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index fe8f8365b..a83737377 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2973,7 +2973,8 @@ std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBloc bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev, int64_t nAdjustedTime) { - const int nHeight = pindexPrev == NULL ? 0 : pindexPrev->nHeight + 1; + assert(pindexPrev != NULL); + const int nHeight = pindexPrev->nHeight + 1; // Check proof of work if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams)) return state.DoS(100, false, REJECT_INVALID, "bad-diffbits", false, "incorrect proof of work"); |