Add locking annotations for variables guarded by cs_KeyStore

This commit is contained in:
practicalswift 2018-04-29 20:14:27 +02:00
parent 3315007e03
commit 4bcd5bb87d
2 changed files with 6 additions and 6 deletions

View file

@ -49,10 +49,10 @@ class CBasicKeyStore : public CKeyStore
protected: protected:
mutable CCriticalSection cs_KeyStore; mutable CCriticalSection cs_KeyStore;
KeyMap mapKeys; KeyMap mapKeys GUARDED_BY(cs_KeyStore);
WatchKeyMap mapWatchKeys; WatchKeyMap mapWatchKeys GUARDED_BY(cs_KeyStore);
ScriptMap mapScripts; ScriptMap mapScripts GUARDED_BY(cs_KeyStore);
WatchOnlySet setWatchOnly; WatchOnlySet setWatchOnly GUARDED_BY(cs_KeyStore);
void ImplicitlyLearnRelatedKeyScripts(const CPubKey& pubkey) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore); void ImplicitlyLearnRelatedKeyScripts(const CPubKey& pubkey) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore);

View file

@ -116,7 +116,7 @@ class CCryptoKeyStore : public CBasicKeyStore
{ {
private: private:
CKeyingMaterial vMasterKey; CKeyingMaterial vMasterKey GUARDED_BY(cs_KeyStore);
//! if fUseCrypto is true, mapKeys must be empty //! if fUseCrypto is true, mapKeys must be empty
//! if fUseCrypto is false, vMasterKey must be empty //! if fUseCrypto is false, vMasterKey must be empty
@ -132,7 +132,7 @@ protected:
bool EncryptKeys(CKeyingMaterial& vMasterKeyIn); bool EncryptKeys(CKeyingMaterial& vMasterKeyIn);
bool Unlock(const CKeyingMaterial& vMasterKeyIn); bool Unlock(const CKeyingMaterial& vMasterKeyIn);
CryptedKeyMap mapCryptedKeys; CryptedKeyMap mapCryptedKeys GUARDED_BY(cs_KeyStore);
public: public:
CCryptoKeyStore() : fUseCrypto(false), fDecryptionThoroughlyChecked(false) CCryptoKeyStore() : fUseCrypto(false), fDecryptionThoroughlyChecked(false)