Skip to content

Commit ef76f3d

Browse files
committed
Merge pull request #4010
94c8bfb Move assert(pindexNew); to above where we dereference pindexNew. (Gregory Maxwell)
2 parents 513412f + 94c8bfb commit ef76f3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2133,11 +2133,11 @@ bool AddToBlockIndex(CBlock& block, CValidationState& state, const CDiskBlockPos
21332133

21342134
// Construct new block index object
21352135
CBlockIndex* pindexNew = new CBlockIndex(block);
2136+
assert(pindexNew);
21362137
{
21372138
LOCK(cs_nBlockSequenceId);
21382139
pindexNew->nSequenceId = nBlockSequenceId++;
21392140
}
2140-
assert(pindexNew);
21412141
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.insert(make_pair(hash, pindexNew)).first;
21422142
pindexNew->phashBlock = &((*mi).first);
21432143
map<uint256, CBlockIndex*>::iterator miPrev = mapBlockIndex.find(block.hashPrevBlock);

0 commit comments

Comments
 (0)