MCPcopy Create free account
hub / github.com/ElementsProject/elements / NeedsRedownload

Method NeedsRedownload

src/validation.cpp:4508–4524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4506}
4507
4508bool CChainState::NeedsRedownload() const
4509{
4510 AssertLockHeld(cs_main);
4511
4512 // At and above m_params.SegwitHeight, segwit consensus rules must be validated
4513 CBlockIndex* block{m_chain.Tip()};
4514
4515 while (block != nullptr && DeploymentActiveAt(*block, m_params.GetConsensus(), Consensus::DEPLOYMENT_SEGWIT)) {
4516 if (!(block->nStatus & BLOCK_OPT_WITNESS)) {
4517 // block is insufficiently validated for a segwit client
4518 return true;
4519 }
4520 block = block->pprev;
4521 }
4522
4523 return false;
4524}
4525
4526void CChainState::UnloadBlockIndex()
4527{

Callers 1

LoadChainstateFunction · 0.80

Calls 2

DeploymentActiveAtFunction · 0.85
TipMethod · 0.45

Tested by

no test coverage detected