Skip to content

Commit f15e780

Browse files
committed
refactor: Clean up CTxMemPool initializer list
Shorten the CTxMemPool initializer list using default initialization for members that dont depend on the constuctor parameters.
1 parent e331069 commit f15e780

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/txmempool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ void CTxMemPoolEntry::UpdateAncestorState(int64_t modifySize, CAmount modifyFee,
332332
}
333333

334334
CTxMemPool::CTxMemPool(CBlockPolicyEstimator* estimator, int check_ratio)
335-
: m_check_ratio(check_ratio), nTransactionsUpdated(0), minerPolicyEstimator(estimator), m_epoch(0), m_has_epoch_guard(false)
335+
: m_check_ratio(check_ratio), minerPolicyEstimator(estimator)
336336
{
337337
_clear(); //lock free clear
338338
}

src/txmempool.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ class CTxMemPool
489489
{
490490
private:
491491
const int m_check_ratio; //!< Value n means that 1 times in n we check.
492-
std::atomic<unsigned int> nTransactionsUpdated; //!< Used by getblocktemplate to trigger CreateNewBlock() invocation
492+
std::atomic<unsigned int> nTransactionsUpdated{0}; //!< Used by getblocktemplate to trigger CreateNewBlock() invocation
493493
CBlockPolicyEstimator* minerPolicyEstimator;
494494

495495
uint64_t totalTxSize; //!< sum of all mempool tx's virtual sizes. Differs from serialized tx size since witness data is discounted. Defined in BIP 141.
@@ -498,8 +498,8 @@ class CTxMemPool
498498
mutable int64_t lastRollingFeeUpdate;
499499
mutable bool blockSinceLastRollingFeeBump;
500500
mutable double rollingMinimumFeeRate; //!< minimum fee to get into the pool, decreases exponentially
501-
mutable uint64_t m_epoch;
502-
mutable bool m_has_epoch_guard;
501+
mutable uint64_t m_epoch{0};
502+
mutable bool m_has_epoch_guard{false};
503503

504504
// In-memory counter for external mempool tracking purposes.
505505
// This number is incremented once every time a transaction

0 commit comments

Comments
 (0)