diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4606621c195c..e7d5ea2ddbe7 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3042,13 +3042,14 @@ CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarge DBErrors CWallet::LoadWallet(bool& fFirstRunRet) { + LOCK2(cs_main, cs_wallet); + if (!fFileBacked) return DB_LOAD_OK; DBErrors nLoadWalletRet = CWalletDB(strWalletFile, "cr+").LoadWallet(this); if (nLoadWalletRet == DB_NEED_REWRITE) { if (CDB::Rewrite(strWalletFile, "\x04pool")) { - LOCK(cs_wallet); // TODO: Implement spk_man->RewriteDB(). m_spk_man->set_pre_split_keypool.clear(); // Note: can't top-up keypool here, because wallet is locked.