Skip to content

Commit 8173f16

Browse files
committed
style: rename variables to match coding style
Rename the variables that were touched by the previous commit (split logical from style changes). minIncrementalFee -> min_incremental_fee minFeeLimit -> min_fee_limit bucketBoundary -> bucket_boundary feeset -> fee_set FeeFilterRounder::feeset -> FeeFilterRounder::m_fee_set
1 parent 8b4ad20 commit 8173f16

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

src/policy/fees.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -998,31 +998,34 @@ void CBlockPolicyEstimator::FlushUnconfirmed() {
998998
LogPrint(BCLog::ESTIMATEFEE, "Recorded %u unconfirmed txs from mempool in %gs\n", num_entries, (endclear - startclear)*0.000001);
999999
}
10001000

1001-
static std::set<double> MakeFeeSet(const CFeeRate& minIncrementalFee,
1001+
static std::set<double> MakeFeeSet(const CFeeRate& min_incremental_fee,
10021002
double max_filter_fee_rate,
10031003
double fee_filter_spacing)
10041004
{
1005-
std::set<double> feeset;
1005+
std::set<double> fee_set;
10061006

1007-
const CAmount minFeeLimit{std::max(CAmount(1), minIncrementalFee.GetFeePerK() / 2)};
1008-
feeset.insert(0);
1009-
for (double bucketBoundary = minFeeLimit; bucketBoundary <= max_filter_fee_rate; bucketBoundary *= fee_filter_spacing) {
1010-
feeset.insert(bucketBoundary);
1007+
const CAmount min_fee_limit{std::max(CAmount(1), min_incremental_fee.GetFeePerK() / 2)};
1008+
fee_set.insert(0);
1009+
for (double bucket_boundary = min_fee_limit;
1010+
bucket_boundary <= max_filter_fee_rate;
1011+
bucket_boundary *= fee_filter_spacing) {
1012+
1013+
fee_set.insert(bucket_boundary);
10111014
}
10121015

1013-
return feeset;
1016+
return fee_set;
10141017
}
10151018

10161019
FeeFilterRounder::FeeFilterRounder(const CFeeRate& minIncrementalFee)
1017-
: feeset{MakeFeeSet(minIncrementalFee, MAX_FILTER_FEERATE, FEE_FILTER_SPACING)}
1020+
: m_fee_set{MakeFeeSet(minIncrementalFee, MAX_FILTER_FEERATE, FEE_FILTER_SPACING)}
10181021
{
10191022
}
10201023

10211024
CAmount FeeFilterRounder::round(CAmount currentMinFee)
10221025
{
1023-
std::set<double>::iterator it = feeset.lower_bound(currentMinFee);
1024-
if (it == feeset.end() ||
1025-
(it != feeset.begin() &&
1026+
std::set<double>::iterator it = m_fee_set.lower_bound(currentMinFee);
1027+
if (it == m_fee_set.end() ||
1028+
(it != m_fee_set.begin() &&
10261029
WITH_LOCK(m_insecure_rand_mutex, return insecure_rand.rand32()) % 3 != 0)) {
10271030
--it;
10281031
}

src/policy/fees.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,13 @@ class FeeFilterRounder
297297

298298
public:
299299
/** Create new FeeFilterRounder */
300-
explicit FeeFilterRounder(const CFeeRate& minIncrementalFee);
300+
explicit FeeFilterRounder(const CFeeRate& min_incremental_fee);
301301

302302
/** Quantize a minimum fee for privacy purpose before broadcast. */
303303
CAmount round(CAmount currentMinFee);
304304

305305
private:
306-
const std::set<double> feeset;
306+
const std::set<double> m_fee_set;
307307
Mutex m_insecure_rand_mutex;
308308
FastRandomContext insecure_rand GUARDED_BY(m_insecure_rand_mutex);
309309
};

0 commit comments

Comments
 (0)