diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4027,11 +4027,10 @@ // Check for duplicate BlockHash hash = block.GetHash(); BlockMap::iterator miSelf = m_block_index.find(hash); - CBlockIndex *pindex = nullptr; if (hash != chainparams.GetConsensus().hashGenesisBlock) { if (miSelf != m_block_index.end()) { // Block header is already known. - pindex = miSelf->second; + CBlockIndex *pindex = miSelf->second; if (ppindex) { *ppindex = pindex; } @@ -4120,9 +4119,7 @@ } } - if (pindex == nullptr) { - pindex = AddToBlockIndex(block); - } + CBlockIndex *pindex = AddToBlockIndex(block); if (ppindex) { *ppindex = pindex;