Skip to content

Commit 4bcd5bb

Browse files
Add locking annotations for variables guarded by cs_KeyStore
1 parent 3315007 commit 4bcd5bb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/keystore.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ class CBasicKeyStore : public CKeyStore
4949
protected:
5050
mutable CCriticalSection cs_KeyStore;
5151

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);
5656

5757
void ImplicitlyLearnRelatedKeyScripts(const CPubKey& pubkey) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore);
5858

src/wallet/crypter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class CCryptoKeyStore : public CBasicKeyStore
116116
{
117117
private:
118118

119-
CKeyingMaterial vMasterKey;
119+
CKeyingMaterial vMasterKey GUARDED_BY(cs_KeyStore);
120120

121121
//! if fUseCrypto is true, mapKeys must be empty
122122
//! if fUseCrypto is false, vMasterKey must be empty
@@ -132,7 +132,7 @@ class CCryptoKeyStore : public CBasicKeyStore
132132
bool EncryptKeys(CKeyingMaterial& vMasterKeyIn);
133133

134134
bool Unlock(const CKeyingMaterial& vMasterKeyIn);
135-
CryptedKeyMap mapCryptedKeys;
135+
CryptedKeyMap mapCryptedKeys GUARDED_BY(cs_KeyStore);
136136

137137
public:
138138
CCryptoKeyStore() : fUseCrypto(false), fDecryptionThoroughlyChecked(false)

0 commit comments

Comments
 (0)