Skip to content

Commit

Permalink
Remove redundant NULL checks after new
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalswift committed Oct 2, 2017
1 parent ee50c9e commit 55224af
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/validation.cpp
Expand Up @@ -2608,7 +2608,6 @@ static CBlockIndex* AddToBlockIndex(const CBlockHeader& block)

// Construct new block index object
CBlockIndex* pindexNew = new CBlockIndex(block);
assert(pindexNew);
// We assign the sequence id to blocks only when the full data is available,
// to avoid miners withholding blocks but broadcasting headers, to get a
// competitive advantage.
Expand Down Expand Up @@ -3434,8 +3433,6 @@ CBlockIndex * InsertBlockIndex(uint256 hash)

// Create new
CBlockIndex* pindexNew = new CBlockIndex();
if (!pindexNew)
throw std::runtime_error(std::string(__func__) + ": new CBlockIndex failed");
mi = mapBlockIndex.insert(std::make_pair(hash, pindexNew)).first;
pindexNew->phashBlock = &((*mi).first);

Expand Down

0 comments on commit 55224af

Please sign in to comment.