Skip to content

Commit 7be33e0

Browse files
morcosrandom-zebra
authored andcommitted
Remove extraneous LogPrint from fee estimation
Once priority estimation was removed, not all transactions in the mempool are tracked in the fee estimation mempool tracking. So there is no error if a transaction is not found for removal.
1 parent 7b6e8a3 commit 7be33e0

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/policy/fees.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -280,19 +280,15 @@ void TxConfirmStats::removeTx(unsigned int entryHeight, unsigned int nBestSeenHe
280280
}
281281
}
282282

283-
void CBlockPolicyEstimator::removeTx(uint256 hash)
283+
bool CBlockPolicyEstimator::removeTx(uint256 hash)
284284
{
285285
std::map<uint256, TxStatsInfo>::iterator pos = mapMemPoolTxs.find(hash);
286-
if (pos == mapMemPoolTxs.end()) {
287-
LogPrint(BCLog::ESTIMATEFEE, "Blockpolicy error mempool tx %s not found for removeTx\n",
288-
hash.ToString().c_str());
289-
return;
286+
if (pos != mapMemPoolTxs.end()) {
287+
feeStats.removeTx(pos->second.blockHeight, nBestSeenHeight, pos->second.bucketIndex);
288+
mapMemPoolTxs.erase(hash);
289+
return true;
290290
}
291-
unsigned int entryHeight = pos->second.blockHeight;
292-
unsigned int bucketIndex = pos->second.bucketIndex;
293-
294-
feeStats.removeTx(entryHeight, nBestSeenHeight, bucketIndex);
295-
mapMemPoolTxs.erase(hash);
291+
return false;
296292
}
297293

298294
CBlockPolicyEstimator::CBlockPolicyEstimator(const CFeeRate& _minRelayFee)

src/policy/fees.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class CBlockPolicyEstimator
214214
void processTransaction(const CTxMemPoolEntry& entry, bool fCurrentEstimate);
215215

216216
/** Remove a transaction from the mempool tracking stats*/
217-
void removeTx(uint256 hash);
217+
bool removeTx(uint256 hash);
218218

219219
/** Return a feerate estimate */
220220
CFeeRate estimateFee(int confTarget);

0 commit comments

Comments
 (0)