aboutsummaryrefslogtreecommitdiff
path: root/src/policy
diff options
context:
space:
mode:
authordergoegge <n.goeggi@gmail.com>2023-10-02 14:21:35 +0100
committerdergoegge <n.goeggi@gmail.com>2023-10-04 13:16:52 +0100
commitfecec3e1c661ba273470ecc5ef12d4c070b53050 (patch)
tree9b7d27beb5e856a7bf0eb16ac8f82ffe06db2982 /src/policy
parent47520ed209d9341702a0fb6006bee6f63f7da42e (diff)
downloadbitcoin-fecec3e1c661ba273470ecc5ef12d4c070b53050.tar.xz
[net processing] FeeFilterRounder doesn't own a FastRandomContext
Diffstat (limited to 'src/policy')
-rw-r--r--src/policy/fees.cpp5
-rw-r--r--src/policy/fees.h4
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