File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -49,10 +49,10 @@ class CBasicKeyStore : public CKeyStore
49
49
protected:
50
50
mutable CCriticalSection cs_KeyStore;
51
51
52
- KeyMap mapKeys;
53
- WatchKeyMap mapWatchKeys;
54
- ScriptMap mapScripts;
55
- WatchOnlySet setWatchOnly;
52
+ KeyMap mapKeys GUARDED_BY (cs_KeyStore) ;
53
+ WatchKeyMap mapWatchKeys GUARDED_BY (cs_KeyStore) ;
54
+ ScriptMap mapScripts GUARDED_BY (cs_KeyStore) ;
55
+ WatchOnlySet setWatchOnly GUARDED_BY (cs_KeyStore) ;
56
56
57
57
void ImplicitlyLearnRelatedKeyScripts (const CPubKey& pubkey) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore);
58
58
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ class CCryptoKeyStore : public CBasicKeyStore
116
116
{
117
117
private:
118
118
119
- CKeyingMaterial vMasterKey;
119
+ CKeyingMaterial vMasterKey GUARDED_BY (cs_KeyStore) ;
120
120
121
121
// ! if fUseCrypto is true, mapKeys must be empty
122
122
// ! if fUseCrypto is false, vMasterKey must be empty
@@ -132,7 +132,7 @@ class CCryptoKeyStore : public CBasicKeyStore
132
132
bool EncryptKeys (CKeyingMaterial& vMasterKeyIn);
133
133
134
134
bool Unlock (const CKeyingMaterial& vMasterKeyIn);
135
- CryptedKeyMap mapCryptedKeys;
135
+ CryptedKeyMap mapCryptedKeys GUARDED_BY (cs_KeyStore) ;
136
136
137
137
public:
138
138
CCryptoKeyStore () : fUseCrypto (false ), fDecryptionThoroughlyChecked (false )
Original file line number Diff line number Diff line change @@ -3168,8 +3168,11 @@ DBErrors CWallet::LoadWallet(bool& fFirstRunRet)
3168
3168
}
3169
3169
}
3170
3170
3171
- // This wallet is in its first run if all of these are empty
3172
- fFirstRunRet = mapKeys.empty () && mapCryptedKeys.empty () && mapWatchKeys.empty () && setWatchOnly.empty () && mapScripts.empty ();
3171
+ {
3172
+ LOCK (cs_KeyStore);
3173
+ // This wallet is in its first run if all of these are empty
3174
+ fFirstRunRet = mapKeys.empty () && mapCryptedKeys.empty () && mapWatchKeys.empty () && setWatchOnly.empty () && mapScripts.empty ();
3175
+ }
3173
3176
3174
3177
if (nLoadWalletRet != DBErrors::LOAD_OK)
3175
3178
return nLoadWalletRet;
You can’t perform that action at this time.
0 commit comments