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 <n.goeggi@gmail.com>
This commit is contained in:
glozow 2022-10-13 14:37:56 -04:00
parent 0384b19414
commit cbb2da8fcf
No known key found for this signature in database
GPG key ID: BA03F4DBE0C63FB4
2 changed files with 2 additions and 1 deletions

View file

@ -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() &&

View file

@ -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;