Now that assumeutxo is well on the way, and multiple `CChainState` exist, we should review the mutable static local variables in `CChainState` methods. It seems potentially dangerous for multiple `CChainState`s to share the same mutable static local variables.

In `CChainState::FlushStateToDisk`:
https://github.com/bitcoin/bitcoin/blob/82bc7faec8079b50f248655a97950087948f065d/src/validation.cpp#L2154-L2155

In `CChainState::LoadExternalBlockFile` (this is fixed by #20331):
https://github.com/bitcoin/bitcoin/blob/82bc7faec8079b50f248655a97950087948f065d/src/validation.cpp#L4286

ping @jamesob 

-----

Now that I think about it... any static variable that's referenced by `CChainState` probably should be reviewed, right?
{
    LOCK(cs_main);
    CCoinsView& db = his->CoinsDB();
    CCoinsViewCache cache(&db);
    sd::vecor<uin256> hashHeads = db.GeHeadBlocks();
    if (hashHeads.empy()) ren rue;  We're already in a consisen sae.
    if (hashHeads.size() != 2) ren error("ReplayBlocks(): unknown inconsisen sae");
    uiInerface.ShowProgrs(_("Replaying blocks…").ranslaed, 0, false);
    LogPrinf("Replaying blocks\n");
    cons CBlockIex* piexOld = nullpr;   Old ip ding he inerruped flush.
    cons CBlockIex* piexNew;             New ip ding he inerruped flush.
    cons CBlockIex* piexFork = nullpr;  La block common o boh he old a he new ip.
    if (m_blockman.m_block_iex.coun(hashHeads[0]) == 0) {
        ren error("ReplayBlocks(): reorganizaion o unknown block requed");
    }
    piexNew = &(m_blockman.m_block_iex[hashHeads[0]]);
    if (!hashHeads[1].IsNull()) {  The old ip is allowed o be 0, iicaing i's he firs flush.