Skip to content

Commit 764e42f

Browse files
scripted-diff: Rename from cs_feeEstimator to m_cs_fee_estimator
-BEGIN VERIFY SCRIPT- sed -i 's/cs_feeEstimator/m_cs_fee_estimator/' src/policy/fees.cpp src/policy/fees.h -END VERIFY SCRIPT-
1 parent 9a789d4 commit 764e42f

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

src/policy/fees.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ void TxConfirmStats::removeTx(unsigned int entryHeight, unsigned int nBestSeenHe
511511
// of no harm to try to remove them again.
512512
bool CBlockPolicyEstimator::removeTx(uint256 hash, bool inBlock)
513513
{
514-
LOCK(cs_feeEstimator);
514+
LOCK(m_cs_fee_estimator);
515515
std::map<uint256, TxStatsInfo>::iterator pos = mapMemPoolTxs.find(hash);
516516
if (pos != mapMemPoolTxs.end()) {
517517
feeStats->removeTx(pos->second.blockHeight, nBestSeenHeight, pos->second.bucketIndex, inBlock);
@@ -548,7 +548,7 @@ CBlockPolicyEstimator::~CBlockPolicyEstimator()
548548

549549
void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, bool validFeeEstimate)
550550
{
551-
LOCK(cs_feeEstimator);
551+
LOCK(m_cs_fee_estimator);
552552
unsigned int txHeight = entry.GetHeight();
553553
uint256 hash = entry.GetTx().GetHash();
554554
if (mapMemPoolTxs.count(hash)) {
@@ -615,7 +615,7 @@ bool CBlockPolicyEstimator::processBlockTx(unsigned int nBlockHeight, const CTxM
615615
void CBlockPolicyEstimator::processBlock(unsigned int nBlockHeight,
616616
std::vector<const CTxMemPoolEntry*>& entries)
617617
{
618-
LOCK(cs_feeEstimator);
618+
LOCK(m_cs_fee_estimator);
619619
if (nBlockHeight <= nBestSeenHeight) {
620620
// Ignore side chains and re-orgs; assuming they are random
621621
// they don't affect the estimate.
@@ -693,7 +693,7 @@ CFeeRate CBlockPolicyEstimator::estimateRawFee(int confTarget, double successThr
693693
}
694694
}
695695

696-
LOCK(cs_feeEstimator);
696+
LOCK(m_cs_fee_estimator);
697697
// Return failure if trying to analyze a target we're not tracking
698698
if (confTarget <= 0 || (unsigned int)confTarget > stats->GetMaxConfirms())
699699
return CFeeRate(0);
@@ -819,7 +819,7 @@ double CBlockPolicyEstimator::estimateConservativeFee(unsigned int doubleTarget,
819819
*/
820820
CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, FeeCalculation *feeCalc, bool conservative) const
821821
{
822-
LOCK(cs_feeEstimator);
822+
LOCK(m_cs_fee_estimator);
823823

824824
if (feeCalc) {
825825
feeCalc->desiredTarget = confTarget;
@@ -899,7 +899,7 @@ CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, FeeCalculation
899899
bool CBlockPolicyEstimator::Write(CAutoFile& fileout) const
900900
{
901901
try {
902-
LOCK(cs_feeEstimator);
902+
LOCK(m_cs_fee_estimator);
903903
fileout << 149900; // version required to read: 0.14.99 or later
904904
fileout << CLIENT_VERSION; // version that wrote the file
905905
fileout << nBestSeenHeight;
@@ -924,7 +924,7 @@ bool CBlockPolicyEstimator::Write(CAutoFile& fileout) const
924924
bool CBlockPolicyEstimator::Read(CAutoFile& filein)
925925
{
926926
try {
927-
LOCK(cs_feeEstimator);
927+
LOCK(m_cs_fee_estimator);
928928
int nVersionRequired, nVersionThatWrote;
929929
filein >> nVersionRequired >> nVersionThatWrote;
930930
if (nVersionRequired > CLIENT_VERSION)
@@ -983,7 +983,7 @@ bool CBlockPolicyEstimator::Read(CAutoFile& filein)
983983

984984
void CBlockPolicyEstimator::FlushUnconfirmed() {
985985
int64_t startclear = GetTimeMicros();
986-
LOCK(cs_feeEstimator);
986+
LOCK(m_cs_fee_estimator);
987987
size_t num_entries = mapMemPoolTxs.size();
988988
// Remove every entry in mapMemPoolTxs
989989
while (!mapMemPoolTxs.empty()) {

src/policy/fees.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,12 @@ class CBlockPolicyEstimator
228228
unsigned int HighestTargetTracked(FeeEstimateHorizon horizon) const;
229229

230230
private:
231-
mutable CCriticalSection cs_feeEstimator;
231+
mutable CCriticalSection m_cs_fee_estimator;
232232

233-
unsigned int nBestSeenHeight GUARDED_BY(cs_feeEstimator);
234-
unsigned int firstRecordedHeight GUARDED_BY(cs_feeEstimator);
235-
unsigned int historicalFirst GUARDED_BY(cs_feeEstimator);
236-
unsigned int historicalBest GUARDED_BY(cs_feeEstimator);
233+
unsigned int nBestSeenHeight GUARDED_BY(m_cs_fee_estimator);
234+
unsigned int firstRecordedHeight GUARDED_BY(m_cs_fee_estimator);
235+
unsigned int historicalFirst GUARDED_BY(m_cs_fee_estimator);
236+
unsigned int historicalBest GUARDED_BY(m_cs_fee_estimator);
237237

238238
struct TxStatsInfo
239239
{
@@ -243,32 +243,32 @@ class CBlockPolicyEstimator
243243
};
244244

245245
// map of txids to information about that transaction
246-
std::map<uint256, TxStatsInfo> mapMemPoolTxs GUARDED_BY(cs_feeEstimator);
246+
std::map<uint256, TxStatsInfo> mapMemPoolTxs GUARDED_BY(m_cs_fee_estimator);
247247

248248
/** Classes to track historical data on transaction confirmations */
249249
std::unique_ptr<TxConfirmStats> feeStats;
250250
std::unique_ptr<TxConfirmStats> shortStats;
251251
std::unique_ptr<TxConfirmStats> longStats;
252252

253-
unsigned int trackedTxs GUARDED_BY(cs_feeEstimator);
254-
unsigned int untrackedTxs GUARDED_BY(cs_feeEstimator);
253+
unsigned int trackedTxs GUARDED_BY(m_cs_fee_estimator);
254+
unsigned int untrackedTxs GUARDED_BY(m_cs_fee_estimator);
255255

256-
std::vector<double> buckets GUARDED_BY(cs_feeEstimator); // The upper-bound of the range for the bucket (inclusive)
257-
std::map<double, unsigned int> bucketMap GUARDED_BY(cs_feeEstimator); // Map of bucket upper-bound to index into all vectors by bucket
256+
std::vector<double> buckets GUARDED_BY(m_cs_fee_estimator); // The upper-bound of the range for the bucket (inclusive)
257+
std::map<double, unsigned int> bucketMap GUARDED_BY(m_cs_fee_estimator); // Map of bucket upper-bound to index into all vectors by bucket
258258

259259
/** Process a transaction confirmed in a block*/
260-
bool processBlockTx(unsigned int nBlockHeight, const CTxMemPoolEntry* entry) EXCLUSIVE_LOCKS_REQUIRED(cs_feeEstimator);
260+
bool processBlockTx(unsigned int nBlockHeight, const CTxMemPoolEntry* entry) EXCLUSIVE_LOCKS_REQUIRED(m_cs_fee_estimator);
261261

262262
/** Helper for estimateSmartFee */
263-
double estimateCombinedFee(unsigned int confTarget, double successThreshold, bool checkShorterHorizon, EstimationResult *result) const EXCLUSIVE_LOCKS_REQUIRED(cs_feeEstimator);
263+
double estimateCombinedFee(unsigned int confTarget, double successThreshold, bool checkShorterHorizon, EstimationResult *result) const EXCLUSIVE_LOCKS_REQUIRED(m_cs_fee_estimator);
264264
/** Helper for estimateSmartFee */
265-
double estimateConservativeFee(unsigned int doubleTarget, EstimationResult *result) const EXCLUSIVE_LOCKS_REQUIRED(cs_feeEstimator);
265+
double estimateConservativeFee(unsigned int doubleTarget, EstimationResult *result) const EXCLUSIVE_LOCKS_REQUIRED(m_cs_fee_estimator);
266266
/** Number of blocks of data recorded while fee estimates have been running */
267-
unsigned int BlockSpan() const EXCLUSIVE_LOCKS_REQUIRED(cs_feeEstimator);
267+
unsigned int BlockSpan() const EXCLUSIVE_LOCKS_REQUIRED(m_cs_fee_estimator);
268268
/** Number of blocks of recorded fee estimate data represented in saved data file */
269-
unsigned int HistoricalBlockSpan() const EXCLUSIVE_LOCKS_REQUIRED(cs_feeEstimator);
269+
unsigned int HistoricalBlockSpan() const EXCLUSIVE_LOCKS_REQUIRED(m_cs_fee_estimator);
270270
/** Calculation of highest target that reasonable estimate can be provided for */
271-
unsigned int MaxUsableEstimate() const EXCLUSIVE_LOCKS_REQUIRED(cs_feeEstimator);
271+
unsigned int MaxUsableEstimate() const EXCLUSIVE_LOCKS_REQUIRED(m_cs_fee_estimator);
272272
};
273273

274274
class FeeFilterRounder

0 commit comments

Comments
 (0)