diff --git a/src/bench/mempool_eviction.cpp b/src/bench/mempool_eviction.cpp --- a/src/bench/mempool_eviction.cpp +++ b/src/bench/mempool_eviction.cpp @@ -97,7 +97,7 @@ tx7.vout[1].scriptPubKey = CScript() << OP_7 << OP_EQUAL; tx7.vout[1].nValue = 10 * COIN; - CTxMemPool pool(CFeeRate(Amount(1000))); + CTxMemPool pool; CTransaction t1(tx1); CTransaction t2(tx2); diff --git a/src/policy/fees.h b/src/policy/fees.h --- a/src/policy/fees.h +++ b/src/policy/fees.h @@ -221,7 +221,7 @@ * Create new BlockPolicyEstimator and initialize stats tracking classes * with default values. */ - CBlockPolicyEstimator(const CFeeRate &minRelayFee); + CBlockPolicyEstimator(); /** Process all the transactions that have been included in a block */ void processBlock(unsigned int nBlockHeight, @@ -266,7 +266,6 @@ private: //!< Passed to constructor to avoid dependency on main - CFeeRate minTrackedFee; unsigned int nBestSeenHeight; struct TxStatsInfo { unsigned int blockHeight; diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -338,13 +338,12 @@ return true; } -CBlockPolicyEstimator::CBlockPolicyEstimator(const CFeeRate &_minRelayFee) +CBlockPolicyEstimator::CBlockPolicyEstimator() : nBestSeenHeight(0), trackedTxs(0), untrackedTxs(0) { static_assert(MIN_FEERATE > Amount(0), "Min feerate must be nonzero"); CFeeRate minFeeRate(MIN_FEERATE); - minTrackedFee = _minRelayFee < minFeeRate ? minFeeRate : _minRelayFee; std::vector vfeelist; - for (double bucketBoundary = minTrackedFee.GetFeePerK().GetSatoshis(); + for (double bucketBoundary = minFeeRate.GetFeePerK().GetSatoshis(); bucketBoundary <= double(MAX_FEERATE.GetSatoshis()); bucketBoundary *= FEE_SPACING) { vfeelist.push_back(bucketBoundary); diff --git a/src/test/blockencodings_tests.cpp b/src/test/blockencodings_tests.cpp --- a/src/test/blockencodings_tests.cpp +++ b/src/test/blockencodings_tests.cpp @@ -62,7 +62,7 @@ #define SHARED_TX_OFFSET 2 BOOST_AUTO_TEST_CASE(SimpleRoundTripTest) { - CTxMemPool pool(CFeeRate(Amount(0))); + CTxMemPool pool; TestMemPoolEntryHelper entry; CBlock block(BuildBlockTestCase()); @@ -172,7 +172,7 @@ }; BOOST_AUTO_TEST_CASE(NonCoinbasePreforwardRTTest) { - CTxMemPool pool(CFeeRate(Amount(0))); + CTxMemPool pool; TestMemPoolEntryHelper entry; CBlock block(BuildBlockTestCase()); @@ -253,7 +253,7 @@ } BOOST_AUTO_TEST_CASE(SufficientPreforwardRTTest) { - CTxMemPool pool(CFeeRate(Amount(0))); + CTxMemPool pool; TestMemPoolEntryHelper entry; CBlock block(BuildBlockTestCase()); @@ -314,7 +314,7 @@ } BOOST_AUTO_TEST_CASE(EmptyBlockRoundTripTest) { - CTxMemPool pool(CFeeRate(Amount(0))); + CTxMemPool pool; CMutableTransaction coinbase; coinbase.vin.resize(1); coinbase.vin[0].scriptSig.resize(10); diff --git a/src/test/mempool_tests.cpp b/src/test/mempool_tests.cpp --- a/src/test/mempool_tests.cpp +++ b/src/test/mempool_tests.cpp @@ -48,7 +48,7 @@ txGrandChild[i].vout[0].nValue = Amount(11000LL); } - CTxMemPool testPool(CFeeRate(Amount(0))); + CTxMemPool testPool; // Nothing in pool, remove should do nothing: unsigned int poolSize = testPool.size(); @@ -115,7 +115,7 @@ txParent.vout[i].nValue = Amount(33000LL); } - CTxMemPool testPool(CFeeRate(Amount(0))); + CTxMemPool testPool; // Nothing in pool, clear should do nothing: testPool.clear(); @@ -148,7 +148,7 @@ } BOOST_AUTO_TEST_CASE(MempoolIndexingTest) { - CTxMemPool pool(CFeeRate(Amount(0))); + CTxMemPool pool; TestMemPoolEntryHelper entry; /* 3rd highest fee */ @@ -365,7 +365,7 @@ } BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest) { - CTxMemPool pool(CFeeRate(Amount(0))); + CTxMemPool pool; TestMemPoolEntryHelper entry; /* 3rd highest fee */ @@ -480,7 +480,7 @@ } BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest) { - CTxMemPool pool(CFeeRate(Amount(1000))); + CTxMemPool pool; TestMemPoolEntryHelper entry; entry.dPriority = 10.0; diff --git a/src/test/policyestimator_tests.cpp b/src/test/policyestimator_tests.cpp --- a/src/test/policyestimator_tests.cpp +++ b/src/test/policyestimator_tests.cpp @@ -15,7 +15,7 @@ BOOST_FIXTURE_TEST_SUITE(policyestimator_tests, BasicTestingSetup) BOOST_AUTO_TEST_CASE(BlockPolicyEstimates) { - CTxMemPool mpool(CFeeRate(Amount(1000))); + CTxMemPool mpool; TestMemPoolEntryHelper entry; Amount basefee(2000); Amount deltaFee(100); diff --git a/src/txmempool.h b/src/txmempool.h --- a/src/txmempool.h +++ b/src/txmempool.h @@ -561,7 +561,7 @@ /** Create a new CTxMemPool. */ - CTxMemPool(const CFeeRate &_minReasonableRelayFee); + CTxMemPool(); ~CTxMemPool(); /** diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -379,8 +379,7 @@ assert(int(nSigOpCountWithAncestors) >= 0); } -CTxMemPool::CTxMemPool(const CFeeRate &_minReasonableRelayFee) - : nTransactionsUpdated(0) { +CTxMemPool::CTxMemPool() : nTransactionsUpdated(0) { // lock free clear _clear(); @@ -389,7 +388,7 @@ // pool nCheckFrequency = 0; - minerPolicyEstimator = new CBlockPolicyEstimator(_minReasonableRelayFee); + minerPolicyEstimator = new CBlockPolicyEstimator(); } CTxMemPool::~CTxMemPool() { diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -84,7 +84,7 @@ CFeeRate minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE); Amount maxTxFee = DEFAULT_TRANSACTION_MAXFEE; -CTxMemPool mempool(::minRelayTxFee); +CTxMemPool mempool; static void CheckBlockIndex(const Consensus::Params &consensusParams);