| 4506 | } |
| 4507 | |
| 4508 | bool 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 | |
| 4526 | void CChainState::UnloadBlockIndex() |
| 4527 | { |
no test coverage detected