diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -564,7 +564,7 @@ // For now, don't change mocktime if we're in the middle of validation, as // this could have an effect on mempool time-based eviction, as well as - // IsCurrentForFeeEstimation() and IsInitialBlockDownload(). + // IsInitialBlockDownload(). // TODO: figure out the right way to synchronize around mocktime, and // ensure all callsites of GetTime() are accessing this safely. LOCK(cs_main); diff --git a/src/txmempool.h b/src/txmempool.h --- a/src/txmempool.h +++ b/src/txmempool.h @@ -596,10 +596,9 @@ // Note that addUnchecked is ONLY called from ATMP outside of tests // and any other callers may break wallet's in-mempool tracking (due to // lack of CValidationInterface::TransactionAddedToMempool callbacks). + bool addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry); bool addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry, - bool validFeeEstimate = true); - bool addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry, - setEntries &setAncestors, bool validFeeEstimate = true); + setEntries &setAncestors); void removeRecursive( const CTransaction &tx, diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -430,7 +430,7 @@ } bool CTxMemPool::addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry, - setEntries &setAncestors, bool validFeeEstimate) { + setEntries &setAncestors) { NotifyEntryAdded(entry.GetSharedTx()); // Add to memory pool without checking anything. // Used by AcceptToMemoryPool(), which DOES do all the appropriate checks. @@ -1107,15 +1107,15 @@ } } -bool CTxMemPool::addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry, - bool validFeeEstimate) { +bool CTxMemPool::addUnchecked(const uint256 &hash, + const CTxMemPoolEntry &entry) { LOCK(cs); setEntries setAncestors; uint64_t nNoLimit = std::numeric_limits::max(); std::string dummy; CalculateMemPoolAncestors(entry, setAncestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy); - return addUnchecked(hash, entry, setAncestors, validFeeEstimate); + return addUnchecked(hash, entry, setAncestors); } void CTxMemPool::UpdateChild(txiter entry, txiter child, bool add) { diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -283,24 +283,6 @@ state.GetRejectCode()); } -static bool IsCurrentForFeeEstimation() { - AssertLockHeld(cs_main); - if (IsInitialBlockDownload()) { - return false; - } - - if (chainActive.Tip()->GetBlockTime() < - (GetTime() - MAX_FEE_ESTIMATION_TIP_AGE)) { - return false; - } - - if (chainActive.Height() < pindexBestHeader->nHeight - 1) { - return false; - } - - return true; -} - static bool IsMagneticAnomalyEnabledForCurrentBlock(const Config &config) { AssertLockHeld(cs_main); return IsMagneticAnomalyEnabled(config, chainActive.Tip()); @@ -708,14 +690,8 @@ "otherwise cause instability!\n"); } - // This transaction should only count for fee estimation if - // the node is not behind and it is not dependent on any other - // transactions in the mempool. - bool validForFeeEstimation = - IsCurrentForFeeEstimation() && pool.HasNoInputsOf(tx); - // Store transaction in memory. - pool.addUnchecked(txid, entry, setAncestors, validForFeeEstimation); + pool.addUnchecked(txid, entry, setAncestors); // Trim mempool and check if tx was trimmed. if (!fOverrideMempoolLimit) {