aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Morcos <[email protected]>2016-11-10 14:16:42 -0500
committerAlex Morcos <[email protected]>2017-01-04 12:03:44 -0500
commit4df44794c9f71d47648e858385d37eae6d0a9db3 (patch)
tree9eae970117aa4740dfdaa2dadc61c07018619b88 /src
parentMerge #9457: [qt] Select more files for translation (diff)
downloaddiscoin-4df44794c9f71d47648e858385d37eae6d0a9db3.tar.xz
discoin-4df44794c9f71d47648e858385d37eae6d0a9db3.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/policy/fees.cpp17
-rw-r--r--src/policy/fees.h2
2 files changed, 8 insertions, 11 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp
index a1b785e3e..52d0e5c5e 100644
--- a/src/policy/fees.cpp
+++ b/src/policy/fees.cpp
@@ -281,19 +281,16 @@ void TxConfirmStats::removeTx(unsigned int entryHeight, unsigned int nBestSeenHe
}
}
-void CBlockPolicyEstimator::removeTx(uint256 hash)
+bool CBlockPolicyEstimator::removeTx(uint256 hash)
{
std::map<uint256, TxStatsInfo>::iterator pos = mapMemPoolTxs.find(hash);
- if (pos == mapMemPoolTxs.end()) {
- LogPrint("estimatefee", "Blockpolicy error mempool tx %s not found for removeTx\n",
- hash.ToString().c_str());
- return;
+ if (pos != mapMemPoolTxs.end()) {
+ feeStats.removeTx(pos->second.blockHeight, nBestSeenHeight, pos->second.bucketIndex);
+ mapMemPoolTxs.erase(hash);
+ return true;
+ } else {
+ return false;
}
- unsigned int entryHeight = pos->second.blockHeight;
- unsigned int bucketIndex = pos->second.bucketIndex;
-
- feeStats.removeTx(entryHeight, nBestSeenHeight, bucketIndex);
- mapMemPoolTxs.erase(hash);
}
CBlockPolicyEstimator::CBlockPolicyEstimator(const CFeeRate& _minRelayFee)
diff --git a/src/policy/fees.h b/src/policy/fees.h
index 1f10cfb23..c88ba5b3c 100644
--- a/src/policy/fees.h
+++ b/src/policy/fees.h
@@ -212,7 +212,7 @@ public:
void processTransaction(const CTxMemPoolEntry& entry, bool fCurrentEstimate);
/** Remove a transaction from the mempool tracking stats*/
- void removeTx(uint256 hash);
+ bool removeTx(uint256 hash);
/** Return a feerate estimate */
CFeeRate estimateFee(int confTarget);