From 5ee5b696b588695ff78aaac08d5d85154f1953cf Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 21 May 2021 10:47:37 +0300 Subject: refactor: Add non-thread-safe CBlockPolicyEstimator::_removeTx helper This changes removes recursion in the m_cs_fee_estimator locks. --- src/policy/fees.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/policy/fees.h') diff --git a/src/policy/fees.h b/src/policy/fees.h index a1fddc9562..fdbf956930 100644 --- a/src/policy/fees.h +++ b/src/policy/fees.h @@ -194,7 +194,8 @@ public: EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator); /** Remove a transaction from the mempool tracking stats*/ - bool removeTx(uint256 hash, bool inBlock); + bool removeTx(uint256 hash, bool inBlock) + EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator); /** DEPRECATED. Return a feerate estimate */ CFeeRate estimateFee(int confTarget) const @@ -278,6 +279,10 @@ private: unsigned int HistoricalBlockSpan() const EXCLUSIVE_LOCKS_REQUIRED(m_cs_fee_estimator); /** Calculation of highest target that reasonable estimate can be provided for */ unsigned int MaxUsableEstimate() const EXCLUSIVE_LOCKS_REQUIRED(m_cs_fee_estimator); + + /** A non-thread-safe helper for the removeTx function */ + bool _removeTx(const uint256& hash, bool inBlock) + EXCLUSIVE_LOCKS_REQUIRED(m_cs_fee_estimator); }; class FeeFilterRounder -- cgit v1.2.3