Skip to content

Commit 968b76f

Browse files
Add missing cs_KeyStore lock
1 parent 4bcd5bb commit 968b76f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3176,8 +3176,11 @@ DBErrors CWallet::LoadWallet(bool& fFirstRunRet)
31763176
}
31773177
}
31783178

3179-
// This wallet is in its first run if all of these are empty
3180-
fFirstRunRet = mapKeys.empty() && mapCryptedKeys.empty() && mapWatchKeys.empty() && setWatchOnly.empty() && mapScripts.empty();
3179+
{
3180+
LOCK(cs_KeyStore);
3181+
// This wallet is in its first run if all of these are empty
3182+
fFirstRunRet = mapKeys.empty() && mapCryptedKeys.empty() && mapWatchKeys.empty() && setWatchOnly.empty() && mapScripts.empty();
3183+
}
31813184

31823185
if (nLoadWalletRet != DBErrors::LOAD_OK)
31833186
return nLoadWalletRet;

0 commit comments

Comments
 (0)