12 const Amount &max_filter_fee_rate,
13 const double fee_filter_spacing) {
14 std::set<Amount> fee_set;
19 for (
double bucket_boundary = min_fee_limit /
SATOSHI;
20 bucket_boundary <= double(max_filter_fee_rate /
SATOSHI);
21 bucket_boundary *= fee_filter_spacing) {
22 fee_set.insert(int64_t(bucket_boundary) *
SATOSHI);
36 auto it =
m_fee_set.lower_bound(currentMinFee);
static constexpr Amount SATOSHI
Fee rate in satoshis per kilobyte: Amount / kB.
Amount GetFeePerK() const
Return the fee in satoshis for a size of 1000 bytes.
const std::set< Amount > m_fee_set
Amount round(const Amount currentMinFee) EXCLUSIVE_LOCKS_REQUIRED(!m_insecure_rand_mutex)
Quantize a minimum fee for privacy purpose before broadcast.
FeeFilterRounder(const CFeeRate &min_incremental_fee, FastRandomContext &rng)
Create new FeeFilterRounder.
Mutex m_insecure_rand_mutex
static std::set< Amount > MakeFeeSet(const CFeeRate &min_incremental_fee, const Amount &max_filter_fee_rate, const double fee_filter_spacing)
static const double FEE_SPACING
Spacing of FeeRate buckets.
static const Amount MAX_FEERATE(int64_t(1e7) *SATOSHI)
static constexpr Amount zero() noexcept
#define AssertLockNotHeld(cs)
#define WITH_LOCK(cs, code)
Run code while locking a mutex.