diff options
author | Alex Morcos <morcos@chaincode.com> | 2017-03-07 11:33:44 -0500 |
---|---|---|
committer | Alex Morcos <morcos@chaincode.com> | 2017-05-10 11:47:44 -0400 |
commit | 3810e976d6a3956dff9e66077415cf04c1fe1f90 (patch) | |
tree | 0f32c47253bb1b439a5935392822a080b58bad73 /src/policy/fees.h | |
parent | c7447ec30348b338e77bc6429fbfac9f93549ef6 (diff) |
Rewrite estimateSmartFee
Change the logic of estimateSmartFee to check a 60% threshold at half the target, a 85% threshold at the target and a 95% threshold at double the target. Always check the shortest time horizon possible and ensure that estimates are monotonically decreasing. Add a conservative mode, which makes sure that the 95% threshold is also met at longer time horizons as well.
Diffstat (limited to 'src/policy/fees.h')
-rw-r--r-- | src/policy/fees.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/policy/fees.h b/src/policy/fees.h index 03adbac4d2..7064ad15c1 100644 --- a/src/policy/fees.h +++ b/src/policy/fees.h @@ -155,7 +155,7 @@ public: * confTarget blocks. If no answer can be given at confTarget, return an * estimate at the lowest target where one can be given. */ - CFeeRate estimateSmartFee(int confTarget, int *answerFoundAtTarget, const CTxMemPool& pool) const; + CFeeRate estimateSmartFee(int confTarget, int *answerFoundAtTarget, const CTxMemPool& pool, bool conservative = true) const; /** Return a specific fee estimate calculation with a given success threshold and time horizon. */ @@ -199,6 +199,8 @@ private: /** Process a transaction confirmed in a block*/ bool processBlockTx(unsigned int nBlockHeight, const CTxMemPoolEntry* entry); + double estimateCombinedFee(unsigned int confTarget, double successThreshold, bool checkShorterHorizon) const; + double estimateConservativeFee(unsigned int doubleTarget) const; }; class FeeFilterRounder |