diff options
author | dergoegge <n.goeggi@gmail.com> | 2023-10-02 14:21:35 +0100 |
---|---|---|
committer | dergoegge <n.goeggi@gmail.com> | 2023-10-04 13:16:52 +0100 |
commit | fecec3e1c661ba273470ecc5ef12d4c070b53050 (patch) | |
tree | 9b7d27beb5e856a7bf0eb16ac8f82ffe06db2982 /src/policy | |
parent | 47520ed209d9341702a0fb6006bee6f63f7da42e (diff) |
[net processing] FeeFilterRounder doesn't own a FastRandomContext
Diffstat (limited to 'src/policy')
-rw-r--r-- | src/policy/fees.cpp | 5 | ||||
-rw-r--r-- | src/policy/fees.h | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index 553c88fddc..87bfa4cfc3 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -1054,8 +1054,9 @@ static std::set<double> MakeFeeSet(const CFeeRate& min_incremental_fee, return fee_set; } -FeeFilterRounder::FeeFilterRounder(const CFeeRate& minIncrementalFee) - : m_fee_set{MakeFeeSet(minIncrementalFee, MAX_FILTER_FEERATE, FEE_FILTER_SPACING)} +FeeFilterRounder::FeeFilterRounder(const CFeeRate& minIncrementalFee, FastRandomContext& rng) + : m_fee_set{MakeFeeSet(minIncrementalFee, MAX_FILTER_FEERATE, FEE_FILTER_SPACING)}, + insecure_rand{rng} { } diff --git a/src/policy/fees.h b/src/policy/fees.h index 8ed13482e9..69bda195be 100644 --- a/src/policy/fees.h +++ b/src/policy/fees.h @@ -320,7 +320,7 @@ private: public: /** Create new FeeFilterRounder */ - explicit FeeFilterRounder(const CFeeRate& min_incremental_fee); + explicit FeeFilterRounder(const CFeeRate& min_incremental_fee, FastRandomContext& rng); /** Quantize a minimum fee for privacy purpose before broadcast. */ CAmount round(CAmount currentMinFee) EXCLUSIVE_LOCKS_REQUIRED(!m_insecure_rand_mutex); @@ -328,7 +328,7 @@ public: private: const std::set<double> m_fee_set; Mutex m_insecure_rand_mutex; - FastRandomContext insecure_rand GUARDED_BY(m_insecure_rand_mutex); + FastRandomContext& insecure_rand GUARDED_BY(m_insecure_rand_mutex); }; #endif // BITCOIN_POLICY_FEES_H |