aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-08-25 18:31:21 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-08-25 18:31:29 -0400
commit91186e59844d6028d689f146d5d58c5e7fc95d58 (patch)
tree5ccfc590275b2c24df7859b19afc021e65283272 /src/wallet/wallet.cpp
parent6516b36731bb8e65ef8dc0dae1e7addb7877c340 (diff)
parent9e0a514112df4f2b85abf09885a8e7898b4c09ae (diff)
downloadbitcoin-91186e59844d6028d689f146d5d58c5e7fc95d58.tar.xz
Merge #13083: Add compile time checking for cs_main runtime locking assertions
9e0a514112 Add compile time checking for all cs_main runtime locking assertions (practicalswift) Pull request description: Add compile time checking for `cs_main` 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: 120e7410c4c223dbc7d42030b1a19e328d01a55f041bb6fb5eaac10ac35cb0c5d469b9b3bda6444731164c73b88ac6495a00890672b107d9305e891571f64dd6
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index d0857bcb72..e7cdbd372e 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -4410,7 +4410,7 @@ bool CMerkleTx::IsImmatureCoinBase() const
return GetBlocksToMaturity() > 0;
}
-bool CWalletTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState& state)
+bool CWalletTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState& state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
{
// We must set fInMempool here - while it will be re-set to true by the
// entered-mempool callback, if we did not there would be a race where a