aboutsummaryrefslogtreecommitdiff
path: root/src/policy
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2023-01-31 11:50:10 +0000
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2023-01-31 11:50:10 +0000
commit96ee992ac3535848e2dc717bf284339badd40dcb (patch)
treee7405ed701334a1fcb99c72b5f0301725918f531 /src/policy
parent357d750cab5221695d718e6d3e8ce63fa2b5ab3a (diff)
downloadbitcoin-96ee992ac3535848e2dc717bf284339badd40dcb.tar.xz
clang-tidy: Fix `modernize-use-default-member-init` in headers
See https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html
Diffstat (limited to 'src/policy')
-rw-r--r--src/policy/fees.cpp2
-rw-r--r--src/policy/fees.h18
2 files changed, 10 insertions, 10 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp
index e4eb932e5c..d244de1bb2 100644
--- a/src/policy/fees.cpp
+++ b/src/policy/fees.cpp
@@ -528,7 +528,7 @@ bool CBlockPolicyEstimator::_removeTx(const uint256& hash, bool inBlock)
}
CBlockPolicyEstimator::CBlockPolicyEstimator(const fs::path& estimation_filepath)
- : m_estimation_filepath{estimation_filepath}, nBestSeenHeight{0}, firstRecordedHeight{0}, historicalFirst{0}, historicalBest{0}, trackedTxs{0}, untrackedTxs{0}
+ : m_estimation_filepath{estimation_filepath}
{
static_assert(MIN_BUCKET_FEERATE > 0, "Min feerate must be nonzero");
size_t bucketIndex = 0;
diff --git a/src/policy/fees.h b/src/policy/fees.h
index dd4f031180..1c24b8c7c3 100644
--- a/src/policy/fees.h
+++ b/src/policy/fees.h
@@ -242,16 +242,16 @@ public:
private:
mutable Mutex m_cs_fee_estimator;
- unsigned int nBestSeenHeight GUARDED_BY(m_cs_fee_estimator);
- unsigned int firstRecordedHeight GUARDED_BY(m_cs_fee_estimator);
- unsigned int historicalFirst GUARDED_BY(m_cs_fee_estimator);
- unsigned int historicalBest GUARDED_BY(m_cs_fee_estimator);
+ unsigned int nBestSeenHeight GUARDED_BY(m_cs_fee_estimator){0};
+ unsigned int firstRecordedHeight GUARDED_BY(m_cs_fee_estimator){0};
+ unsigned int historicalFirst GUARDED_BY(m_cs_fee_estimator){0};
+ unsigned int historicalBest GUARDED_BY(m_cs_fee_estimator){0};
struct TxStatsInfo
{
- unsigned int blockHeight;
- unsigned int bucketIndex;
- TxStatsInfo() : blockHeight(0), bucketIndex(0) {}
+ unsigned int blockHeight{0};
+ unsigned int bucketIndex{0};
+ TxStatsInfo() {}
};
// map of txids to information about that transaction
@@ -262,8 +262,8 @@ private:
std::unique_ptr<TxConfirmStats> shortStats PT_GUARDED_BY(m_cs_fee_estimator);
std::unique_ptr<TxConfirmStats> longStats PT_GUARDED_BY(m_cs_fee_estimator);
- unsigned int trackedTxs GUARDED_BY(m_cs_fee_estimator);
- unsigned int untrackedTxs GUARDED_BY(m_cs_fee_estimator);
+ unsigned int trackedTxs GUARDED_BY(m_cs_fee_estimator){0};
+ unsigned int untrackedTxs GUARDED_BY(m_cs_fee_estimator){0};
std::vector<double> buckets GUARDED_BY(m_cs_fee_estimator); // The upper-bound of the range for the bucket (inclusive)
std::map<double, unsigned int> bucketMap GUARDED_BY(m_cs_fee_estimator); // Map of bucket upper-bound to index into all vectors by bucket