diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-12-19 09:58:06 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-12-19 10:00:58 +0100 |
commit | 012ca1c9e4f21e0414f965cb812ecb1f2ddb4f67 (patch) | |
tree | a9cfb699a58ad9d201e739fa8523b93592a40f27 /src/wallet.cpp | |
parent | 956916806a932b3502d8a1add410fd393c005df0 (diff) |
LoadWallet: acquire cs_wallet mutex before clearing setKeyPool
Make the function mutex-aware, to prevent having to lock cs_wallet
at the call site in Init.
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r-- | src/wallet.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index 6601575d88..cfaa0d6b9f 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 |