diff --git a/src/wallet.cpp b/src/wallet.cpp index 6601575d8..cfaa0d6b9 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1489,7 +1489,6 @@ string CWallet::SendMoneyToDestination(const CTxDestination& address, int64_t nV DBErrors CWallet::LoadWallet(bool& fFirstRunRet) { - AssertLockHeld(cs_wallet); // setKeyPool if (!fFileBacked) return DB_LOAD_OK; fFirstRunRet = false; @@ -1498,6 +1497,7 @@ DBErrors CWallet::LoadWallet(bool& fFirstRunRet) { if (CDB::Rewrite(strWalletFile, "\x04pool")) { + LOCK(cs_wallet); setKeyPool.clear(); // Note: can't top-up keypool here, because wallet is locked. // User will be prompted to unlock wallet the next operation