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).
#include <scheduler.h>
#include <timedata.h>
#include <txmempool.h>
#include <utilmoneystr.h>
#include <wallet/fees.h>
#include <algorithm>
#include <assert.h>
#include <future>
#include <boost/algorithm/string/replace.hpp>
static CCriticalSection cs_wallets;
static std::vector<CWallet*> vpwallets GUARDED_BY(cs_wallets);
bool AddWallet(CWallet* wallet)
{
    LOCK(cs_wallets);
    assert(wallet);
    std::vector<CWallet*>::const_iterator i = std::find(vpwallets.begin(), vpwallets.end(), wallet);
    if (i != vpwallets.end()) return false;
    vpwallets.push_back(wallet);
    return true;
}
bool RemoveWallet(CWallet* wallet)
{
    LOCK(cs_wallets);
    assert(wallet);
    std::vector<CWallet*>::iterator i = std::find(vpwallets.begin(), vpwallets.end(), wallet);
    if (i == vpwallets.end()) return false;
    vpwallets.erase(i);
    return true;
}
bool HasWallets()