From e8bcdce8a245af235f8be9853c8f81c9bda56412 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 13 Oct 2015 00:57:41 -0700 Subject: [PATCH] Track (and define) ::minRelayTxFee in CTxMemPool --- src/txmempool.cpp | 5 +++-- src/txmempool.h | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/txmempool.cpp b/src/txmempool.cpp index aa5aec055..e8d76dd2f 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -305,7 +305,7 @@ void CTxMemPoolEntry::UpdateState(int64_t modifySize, CAmount modifyFee, int64_t } } -CTxMemPool::CTxMemPool(const CFeeRate& _minRelayFee) : +CTxMemPool::CTxMemPool(const CFeeRate& _minReasonableRelayFee) : nTransactionsUpdated(0) { // Sanity checks off by default for performance, because otherwise @@ -313,7 +313,8 @@ CTxMemPool::CTxMemPool(const CFeeRate& _minRelayFee) : // of transactions in the pool fSanityCheck = false; - minerPolicyEstimator = new CBlockPolicyEstimator(_minRelayFee); + minerPolicyEstimator = new CBlockPolicyEstimator(_minReasonableRelayFee); + minReasonableRelayFee = _minReasonableRelayFee; } CTxMemPool::~CTxMemPool() diff --git a/src/txmempool.h b/src/txmempool.h index cee1a146d..e45867f71 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -285,6 +285,8 @@ private: uint64_t totalTxSize; //! sum of all mempool tx' byte sizes uint64_t cachedInnerUsage; //! sum of dynamic memory usage of all the map elements (NOT the maps themselves) + CFeeRate minReasonableRelayFee; + public: typedef boost::multi_index_container< CTxMemPoolEntry, @@ -334,7 +336,12 @@ public: std::map mapNextTx; std::map > mapDeltas; - CTxMemPool(const CFeeRate& _minRelayFee); + /** Create a new CTxMemPool. + * minReasonableRelayFee should be a feerate which is, roughly, somewhere + * around what it "costs" to relay a transaction around the network and + * below which we would reasonably say a transaction has 0-effective-fee. + */ + CTxMemPool(const CFeeRate& _minReasonableRelayFee); ~CTxMemPool(); /**