diff options
author | Andrew Chow <github@achow101.com> | 2022-10-13 16:02:01 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2022-10-13 16:02:13 -0400 |
commit | deeb70a165ad2ebdba6e4ada99af62e988960842 (patch) | |
tree | 9cf5a99551e1448fbd1bc59fa12f5e64e8cf4e5a | |
parent | 0384b194149305ffc8580ad6947e0471a36446ff (diff) | |
parent | cbb2da8fcf0c81453695c4ec8ce6c467e6a5c8ba (diff) |
Merge bitcoin/bitcoin#26306: add lock annotation for FeeFilterRounder::round()
cbb2da8fcf0c81453695c4ec8ce6c467e6a5c8ba add lock annotation for FeeFilterRounder::round() (glozow)
Pull request description:
CI failure from #24407: https://github.com/bitcoin/bitcoin/runs/8876014446
Calling `WITH_LOCK()` on a non-recursive mutex requires not holding it beforehand.
ACKs for top commit:
achow101:
ACK cbb2da8fcf0c81453695c4ec8ce6c467e6a5c8ba
dergoegge:
ACK cbb2da8fcf0c81453695c4ec8ce6c467e6a5c8ba
hebasto:
ACK cbb2da8fcf0c81453695c4ec8ce6c467e6a5c8ba, tested on Ubuntu 22.04 with clang 14.0.
Tree-SHA512: d6782ee48442b9d64d58a54c1ec7c53822ab051bf9728b44d6a0e05f1953e90f16420d349379345845db203fbad4e1f5750d9070adcb7daa18f12359a29488ca
-rw-r--r-- | src/policy/fees.cpp | 1 | ||||
-rw-r--r-- | src/policy/fees.h | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index 98b4bdef9b..ab5599a1b4 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -1036,6 +1036,7 @@ FeeFilterRounder::FeeFilterRounder(const CFeeRate& minIncrementalFee) CAmount FeeFilterRounder::round(CAmount currentMinFee) { + AssertLockNotHeld(m_insecure_rand_mutex); std::set<double>::iterator it = m_fee_set.lower_bound(currentMinFee); if (it == m_fee_set.end() || (it != m_fee_set.begin() && diff --git a/src/policy/fees.h b/src/policy/fees.h index c345546895..204c4f2118 100644 --- a/src/policy/fees.h +++ b/src/policy/fees.h @@ -302,7 +302,7 @@ public: explicit FeeFilterRounder(const CFeeRate& min_incremental_fee); /** Quantize a minimum fee for privacy purpose before broadcast. */ - CAmount round(CAmount currentMinFee); + CAmount round(CAmount currentMinFee) EXCLUSIVE_LOCKS_REQUIRED(!m_insecure_rand_mutex); private: const std::set<double> m_fee_set; |