Browse Source

Merge pull request #4010

94c8bfb Move assert(pindexNew); to above where we dereference pindexNew. (Gregory Maxwell)
metaverse
Wladimir J. van der Laan 10 years ago
parent
commit
ef76f3d62c
No known key found for this signature in database GPG Key ID: 74810B012346C9A6
  1. 2
      src/main.cpp

2
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<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.insert(make_pair(hash, pindexNew)).first;
pindexNew->phashBlock = &((*mi).first);
map<uint256, CBlockIndex*>::iterator miPrev = mapBlockIndex.find(block.hashPrevBlock);

Loading…
Cancel
Save