Skip to content

Commit 3315007

Browse files
author
MarcoFalke
committed
Merge #13077: Add compile time checking for all cs_KeyStore runtime locking assertions
66dc662 Add compile time checking for all cs_KeyStore runtime locking assertions (practicalswift) Pull request description: Add compile time checking for all `cs_KeyStore` runtime locking assertions. This PR is a subset of #12665. The PR was broken up to make reviewing easier. The intention is that literally all `EXCLUSIVE_LOCKS_REQUIRED`/`LOCKS_EXCLUDED`:s added in this PR should follow either directly or indirectly from `AssertLockHeld(…)`/`AssertLockNotHeld(…)`:s already existing in the repo. Consider the case where function `A(…)` contains `AssertLockHeld(cs_foo)` (without first locking `cs_foo` in `A`), and that `B(…)` calls `A(…)` (without first locking `cs_main`): * It _directly_ follows that: `A(…)` should have an `EXCLUSIVE_LOCKS_REQUIRED(cs_foo)` annotation. * It _indirectly_ follows that: `B(…)` should have an `EXCLUSIVE_LOCKS_REQUIRED(cs_foo)` annotation. Tree-SHA512: 84ee5459e7f75f9affaa4275cb760576ab0e26da8a48b9a4a59b51a25418fe4b862ba832cb01312479a8c9b0e38ee8b6c4076bcbbd73213346d09ec2057fc9f1
2 parents 17266a1 + 66dc662 commit 3315007

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/keystore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CBasicKeyStore : public CKeyStore
5454
ScriptMap mapScripts;
5555
WatchOnlySet setWatchOnly;
5656

57-
void ImplicitlyLearnRelatedKeyScripts(const CPubKey& pubkey);
57+
void ImplicitlyLearnRelatedKeyScripts(const CPubKey& pubkey) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore);
5858

5959
public:
6060
bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey) override;

0 commit comments

Comments
 (0)