Skip to content

Commit 55224af

Browse files
Remove redundant NULL checks after new
1 parent ee50c9e commit 55224af

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/validation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2608,7 +2608,6 @@ static CBlockIndex* AddToBlockIndex(const CBlockHeader& block)
26082608

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

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

0 commit comments

Comments
 (0)