From 968b76f77ca51b9df737011ff486efbae9c8de81 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Sun, 29 Apr 2018 20:15:05 +0200 Subject: [PATCH] Add missing cs_KeyStore lock --- src/wallet/wallet.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index ad3dd4cd2..a760d2d13 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3176,8 +3176,11 @@ DBErrors CWallet::LoadWallet(bool& fFirstRunRet) } } - // This wallet is in its first run if all of these are empty - fFirstRunRet = mapKeys.empty() && mapCryptedKeys.empty() && mapWatchKeys.empty() && setWatchOnly.empty() && mapScripts.empty(); + { + LOCK(cs_KeyStore); + // This wallet is in its first run if all of these are empty + fFirstRunRet = mapKeys.empty() && mapCryptedKeys.empty() && mapWatchKeys.empty() && setWatchOnly.empty() && mapScripts.empty(); + } if (nLoadWalletRet != DBErrors::LOAD_OK) return nLoadWalletRet;