When the wallet is rescanned at startup in `bitcoind`, there seems to be no way to interrupt that in a clean way (other than forcefully killing the process).
{
    LOCK2(cs_main, cs_wallet);
    fFirstRunRet = false;
    DBErrors nLoadWalletRet = WalletBatch(*database,"cr+").LoadWallet(this);
    if (nLoadWalletRet == DBErrors::NEED_REWRITE)
    {
        if (database->Rewrite("\x04pool"))
        {
            setInternalKeyPool.clear();
            setExternalKeyPool.clear();
            m_pool_key_to_index.clear();
            
            
            
        }
    }
    
    fFirstRunRet = mapKeys.empty() && mapCryptedKeys.empty() && mapWatchKeys.empty() && setWatchOnly.empty() && mapScripts.empty();
    if (nLoadWalletRet != DBErrors::LOAD_OK)
        return nLoadWalletRet;
    uiInterface.LoadWallet(this);
    return DBErrors::LOAD_OK;
}
DBErrors CWallet::ZapSelectTx(std::vector<uint256>& vHashIn, std::vector<uint256>& vHashOut)