Remove unused SetTip(nullptr) code

This commit is contained in:
MacroFake
2022-04-29 09:41:09 +02:00
parent 816ca01650
commit faab8dceb3
5 changed files with 15 additions and 16 deletions

View File

@@ -2578,6 +2578,7 @@ bool CChainState::DisconnectTip(BlockValidationState& state, DisconnectedBlockTr
CBlockIndex *pindexDelete = m_chain.Tip();
assert(pindexDelete);
assert(pindexDelete->pprev);
// Read block from disk.
std::shared_ptr<CBlock> pblock = std::make_shared<CBlock>();
CBlock& block = *pblock;
@@ -2625,7 +2626,7 @@ bool CChainState::DisconnectTip(BlockValidationState& state, DisconnectedBlockTr
}
}
m_chain.SetTip(pindexDelete->pprev);
m_chain.SetTip(*pindexDelete->pprev);
UpdateTip(pindexDelete->pprev);
// Let wallets know transactions went from 1-confirmed to
@@ -2739,7 +2740,7 @@ bool CChainState::ConnectTip(BlockValidationState& state, CBlockIndex* pindexNew
disconnectpool.removeForBlock(blockConnecting.vtx);
}
// Update m_chain & related variables.
m_chain.SetTip(pindexNew);
m_chain.SetTip(*pindexNew);
UpdateTip(pindexNew);
int64_t nTime6 = GetTimeMicros(); nTimePostConnect += nTime6 - nTime5; nTimeTotal += nTime6 - nTime1;
@@ -3887,7 +3888,7 @@ bool CChainState::LoadChainTip()
if (!pindex) {
return false;
}
m_chain.SetTip(pindex);
m_chain.SetTip(*pindex);
PruneBlockIndexCandidates();
tip = m_chain.Tip();
@@ -4964,7 +4965,7 @@ bool ChainstateManager::PopulateAndValidateSnapshot(
return false;
}
snapshot_chainstate.m_chain.SetTip(snapshot_start_block);
snapshot_chainstate.m_chain.SetTip(*snapshot_start_block);
// The remainder of this function requires modifying data protected by cs_main.
LOCK(::cs_main);