From 94c8bfb23b4289c74846f4c39704261987d11b1c Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Sat, 5 Apr 2014 22:11:16 -0700 Subject: [PATCH] Move assert(pindexNew); to above where we dereference pindexNew. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 45f4935e4..c4d619485 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2133,11 +2133,11 @@ bool AddToBlockIndex(CBlock& block, CValidationState& state, const CDiskBlockPos // Construct new block index object CBlockIndex* pindexNew = new CBlockIndex(block); + assert(pindexNew); { LOCK(cs_nBlockSequenceId); pindexNew->nSequenceId = nBlockSequenceId++; } - assert(pindexNew); map::iterator mi = mapBlockIndex.insert(make_pair(hash, pindexNew)).first; pindexNew->phashBlock = &((*mi).first); map::iterator miPrev = mapBlockIndex.find(block.hashPrevBlock);