Skip to content

Commit bfd295b

Browse files
practicalswiftrandom-zebra
authored andcommitted
Remove redundant NULL checks after new
1 parent 97aad32 commit bfd295b

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
@@ -2455,7 +2455,6 @@ CBlockIndex* AddToBlockIndex(const CBlock& block)
24552455

24562456
// Construct new block index object
24572457
CBlockIndex* pindexNew = new CBlockIndex(block);
2458-
assert(pindexNew);
24592458
// We assign the sequence id to blocks only when the full data is available,
24602459
// to avoid miners withholding blocks but broadcasting headers, to get a
24612460
// competitive advantage.
@@ -3394,8 +3393,6 @@ CBlockIndex* InsertBlockIndex(uint256 hash)
33943393

33953394
// Create new
33963395
CBlockIndex* pindexNew = new CBlockIndex();
3397-
if (!pindexNew)
3398-
throw std::runtime_error("LoadBlockIndex() : new CBlockIndex failed");
33993396
mi = mapBlockIndex.emplace(hash, pindexNew).first;
34003397

34013398
pindexNew->phashBlock = &((*mi).first);

0 commit comments

Comments
 (0)