aboutsummaryrefslogtreecommitdiff
path: root/src/policy/fees.h
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2017-03-09 15:26:05 -0500
committerAlex Morcos <morcos@chaincode.com>2017-05-10 11:45:27 -0400
commitc7447ec30348b338e77bc6429fbfac9f93549ef6 (patch)
treed29e992933923be972226b92b687cd081183e504 /src/policy/fees.h
parent4186d3fdfd319b568b520dd587be27bdff45c53d (diff)
Track failures in fee estimation.
Start tracking transactions which fail to confirm within the target and are then evicted or otherwise leave mempool. Fix slight error in unit test.
Diffstat (limited to 'src/policy/fees.h')
-rw-r--r--src/policy/fees.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/policy/fees.h b/src/policy/fees.h
index f42fe7bda7..03adbac4d2 100644
--- a/src/policy/fees.h
+++ b/src/policy/fees.h
@@ -74,6 +74,7 @@ struct EstimatorBucket
double withinTarget = 0;
double totalConfirmed = 0;
double inMempool = 0;
+ double leftMempool = 0;
};
struct EstimationResult
@@ -145,7 +146,7 @@ public:
void processTransaction(const CTxMemPoolEntry& entry, bool validFeeEstimate);
/** Remove a transaction from the mempool tracking stats*/
- bool removeTx(uint256 hash);
+ bool removeTx(uint256 hash, bool inBlock);
/** Return a feerate estimate */
CFeeRate estimateFee(int confTarget) const;
@@ -166,6 +167,9 @@ public:
/** Read estimation data from a file */
bool Read(CAutoFile& filein);
+ /** Empty mempool transactions on shutdown to record failure to confirm for txs still in mempool */
+ void FlushUnconfirmed(CTxMemPool& pool);
+
private:
CFeeRate minTrackedFee; //!< Passed to constructor to avoid dependency on main
unsigned int nBestSeenHeight;