Skip to content

Commit cbb2da8

Browse files
glozowdergoegge
andcommitted
add lock annotation for FeeFilterRounder::round()
Calling WITH_LOCK() on a non-recursive mutex requires not holding it beforehand. Co-authored-by: Niklas Gögge <[email protected]>
1 parent 0384b19 commit cbb2da8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/policy/fees.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,7 @@ FeeFilterRounder::FeeFilterRounder(const CFeeRate& minIncrementalFee)
10361036

10371037
CAmount FeeFilterRounder::round(CAmount currentMinFee)
10381038
{
1039+
AssertLockNotHeld(m_insecure_rand_mutex);
10391040
std::set<double>::iterator it = m_fee_set.lower_bound(currentMinFee);
10401041
if (it == m_fee_set.end() ||
10411042
(it != m_fee_set.begin() &&

src/policy/fees.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class FeeFilterRounder
302302
explicit FeeFilterRounder(const CFeeRate& min_incremental_fee);
303303

304304
/** Quantize a minimum fee for privacy purpose before broadcast. */
305-
CAmount round(CAmount currentMinFee);
305+
CAmount round(CAmount currentMinFee) EXCLUSIVE_LOCKS_REQUIRED(!m_insecure_rand_mutex);
306306

307307
private:
308308
const std::set<double> m_fee_set;

0 commit comments

Comments
 (0)