Skip to content

Commit 4df4479

Browse files
committed
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 123ea73 commit 4df4479

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/policy/fees.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -281,19 +281,16 @@ void TxConfirmStats::removeTx(unsigned int entryHeight, unsigned int nBestSeenHe
281281
}
282282
}
283283

284-
void CBlockPolicyEstimator::removeTx(uint256 hash)
284+
bool CBlockPolicyEstimator::removeTx(uint256 hash)
285285
{
286286
std::map<uint256, TxStatsInfo>::iterator pos = mapMemPoolTxs.find(hash);
287-
if (pos == mapMemPoolTxs.end()) {
288-
LogPrint("estimatefee", "Blockpolicy error mempool tx %s not found for removeTx\n",
289-
hash.ToString().c_str());
290-
return;
287+
if (pos != mapMemPoolTxs.end()) {
288+
feeStats.removeTx(pos->second.blockHeight, nBestSeenHeight, pos->second.bucketIndex);
289+
mapMemPoolTxs.erase(hash);
290+
return true;
291+
} else {
292+
return false;
291293
}
292-
unsigned int entryHeight = pos->second.blockHeight;
293-
unsigned int bucketIndex = pos->second.bucketIndex;
294-
295-
feeStats.removeTx(entryHeight, nBestSeenHeight, bucketIndex);
296-
mapMemPoolTxs.erase(hash);
297294
}
298295

299296
CBlockPolicyEstimator::CBlockPolicyEstimator(const CFeeRate& _minRelayFee)

src/policy/fees.h

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

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

217217
/** Return a feerate estimate */
218218
CFeeRate estimateFee(int confTarget);

0 commit comments

Comments
 (0)