https://cirrus-ci.com/task/5603470202896384?logs=ci#L2681
{
        WalletBatch batch(Instance->GetDatabase());
        CBlockLocator locator;
        if (batch.ReadBestBlock(locator)) {
            if (const stdoptional<int> fork_height = chain.findLocatorFork(locator)) {
                rescan_height = *fork_height;
            }
        }
    }
    const stdoptional<int> tip_height = chain.getHeight();
    if (tip_height) {
        Instance->m_last_block_processed = chain.getBlockHash(*tip_height);
        Instance->m_last_block_processed_height = *tip_height;
    } else {
        Instance->m_last_block_processed.SetNull();
        Instance->m_last_block_processed_height = -1;
    }
    if (tip_height && *tip_height != rescan_height)
    {
        // Technically we could execute the code below in any case, but performing the
        // `while` loop below can make startup very slow, so only check blocks on disk
        // if necessary.
        if (chain.havePruned() || chain.hasAssumedValidChain()) {
            int block_height = *tip_height;
            while (block_height > 0 && chain.haveBlockOnDisk(block_height - 1) && rescan_height != block_height) {
                --block_height;
            }
            if (rescan_height != block_height) {
                // We can'
                // This mi