Fix potential null dereferences

This commit is contained in:
MeshCollider
2017-08-23 19:47:56 +12:00
parent 3e55f13bfc
commit c001992440
4 changed files with 8 additions and 0 deletions

View File

@@ -145,6 +145,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
LOCK2(cs_main, mempool.cs);
CBlockIndex* pindexPrev = chainActive.Tip();
assert(pindexPrev != nullptr);
nHeight = pindexPrev->nHeight + 1;
pblock->nVersion = ComputeBlockVersion(pindexPrev, chainparams.GetConsensus());