mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-17 05:30:43 +02:00
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
This commit is contained in:
parent
8b4ad203d0
commit
8173f160e0
@ -998,31 +998,34 @@ void CBlockPolicyEstimator::FlushUnconfirmed() {
|
|||||||
LogPrint(BCLog::ESTIMATEFEE, "Recorded %u unconfirmed txs from mempool in %gs\n", num_entries, (endclear - startclear)*0.000001);
|
LogPrint(BCLog::ESTIMATEFEE, "Recorded %u unconfirmed txs from mempool in %gs\n", num_entries, (endclear - startclear)*0.000001);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::set<double> MakeFeeSet(const CFeeRate& minIncrementalFee,
|
static std::set<double> MakeFeeSet(const CFeeRate& min_incremental_fee,
|
||||||
double max_filter_fee_rate,
|
double max_filter_fee_rate,
|
||||||
double fee_filter_spacing)
|
double fee_filter_spacing)
|
||||||
{
|
{
|
||||||
std::set<double> feeset;
|
std::set<double> fee_set;
|
||||||
|
|
||||||
const CAmount minFeeLimit{std::max(CAmount(1), minIncrementalFee.GetFeePerK() / 2)};
|
const CAmount min_fee_limit{std::max(CAmount(1), min_incremental_fee.GetFeePerK() / 2)};
|
||||||
feeset.insert(0);
|
fee_set.insert(0);
|
||||||
for (double bucketBoundary = minFeeLimit; bucketBoundary <= max_filter_fee_rate; bucketBoundary *= fee_filter_spacing) {
|
for (double bucket_boundary = min_fee_limit;
|
||||||
feeset.insert(bucketBoundary);
|
bucket_boundary <= max_filter_fee_rate;
|
||||||
|
bucket_boundary *= fee_filter_spacing) {
|
||||||
|
|
||||||
|
fee_set.insert(bucket_boundary);
|
||||||
}
|
}
|
||||||
|
|
||||||
return feeset;
|
return fee_set;
|
||||||
}
|
}
|
||||||
|
|
||||||
FeeFilterRounder::FeeFilterRounder(const CFeeRate& minIncrementalFee)
|
FeeFilterRounder::FeeFilterRounder(const CFeeRate& minIncrementalFee)
|
||||||
: feeset{MakeFeeSet(minIncrementalFee, MAX_FILTER_FEERATE, FEE_FILTER_SPACING)}
|
: m_fee_set{MakeFeeSet(minIncrementalFee, MAX_FILTER_FEERATE, FEE_FILTER_SPACING)}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
CAmount FeeFilterRounder::round(CAmount currentMinFee)
|
CAmount FeeFilterRounder::round(CAmount currentMinFee)
|
||||||
{
|
{
|
||||||
std::set<double>::iterator it = feeset.lower_bound(currentMinFee);
|
std::set<double>::iterator it = m_fee_set.lower_bound(currentMinFee);
|
||||||
if (it == feeset.end() ||
|
if (it == m_fee_set.end() ||
|
||||||
(it != feeset.begin() &&
|
(it != m_fee_set.begin() &&
|
||||||
WITH_LOCK(m_insecure_rand_mutex, return insecure_rand.rand32()) % 3 != 0)) {
|
WITH_LOCK(m_insecure_rand_mutex, return insecure_rand.rand32()) % 3 != 0)) {
|
||||||
--it;
|
--it;
|
||||||
}
|
}
|
||||||
|
@ -297,13 +297,13 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/** Create new FeeFilterRounder */
|
/** Create new FeeFilterRounder */
|
||||||
explicit FeeFilterRounder(const CFeeRate& minIncrementalFee);
|
explicit FeeFilterRounder(const CFeeRate& min_incremental_fee);
|
||||||
|
|
||||||
/** Quantize a minimum fee for privacy purpose before broadcast. */
|
/** Quantize a minimum fee for privacy purpose before broadcast. */
|
||||||
CAmount round(CAmount currentMinFee);
|
CAmount round(CAmount currentMinFee);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const std::set<double> feeset;
|
const std::set<double> m_fee_set;
|
||||||
Mutex m_insecure_rand_mutex;
|
Mutex m_insecure_rand_mutex;
|
||||||
FastRandomContext insecure_rand GUARDED_BY(m_insecure_rand_mutex);
|
FastRandomContext insecure_rand GUARDED_BY(m_insecure_rand_mutex);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user