`RewindBlockIndex` was made to allow nodes upgrading to new consensus rules post-segwit fork to 
download new consensus data (i.e witnesses) without having to go through a whole IBD. It has been pointed than now really few pre-segwit nodes care to upgrade and that this logic may be irrelevant.

See https://github.com/bitcoin/bitcoin/pull/17737#discussion_r358514335 in review  of #17737 for more context pointers.
tip = tip->pprev;
        }
        
        LimitValidationInterfaceQueue();
        
        if (!FlushStateToDisk(params, state, FlushStateMode::PERIODIC)) {
            LogPrintf("RewindBlockIndex: unable to flush state to disk (%s)\n", state.ToString());
            return false;
        }
    }
    {
        LOCK(cs_main);
        if (m_chain.Tip() != nullptr) {
            
            
            PruneBlockIndexCandidates();
            CheckBlockIndex(params.GetConsensus());
            
            
            
            BlockValidationState state;
            if (!FlushStateToDisk(params, state, FlushStateMode::ALWAYS)) {
                LogPrintf("RewindBlockIndex: unable to flush state to disk (%s)\n", state.ToString());
                return false;
            }
        }
    }
    return true;
}
void CChainState::UnloadBlockIndex() {