Skip to content

Commit f9d8910

Browse files
committed
Merge bitcoin/bitcoin#31080: fees: document non-monotonic estimation edge case
1e0de7a fees: document non-monotonic estimation edge case (willcl-ark) Pull request description: Closes: bitcoin/bitcoin#11800 In scenarios where data is available for higher targets but not for lower ones, this method *may* return lower fee rates for higher confirmation targets. This could occur if `estimateCombinedFee` returns no valid data (`-1`) for some estimates for a low target, but **does** return valid data for a higher target. Users of this function should be aware of this potential, if unlikely, inconsistency in behaviour in data-sparse scenarios. ACKs for top commit: adamandrews1: Code review ACK 1e0de7a ismaelsadeeq: Code review ACK 1e0de7a glozow: ACK 1e0de7a Tree-SHA512: 161e5dafdd131570853a89491753ae39a7b725d1a86cab5a7294c2a5939da1a9a5f2c4aca0900e9ad810e828b6e0e636f256384e3d1fda6dd552da189bbbe747
2 parents 31650b4 + 1e0de7a commit f9d8910

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/policy/fees.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,14 @@ CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, FeeCalculation
905905
* horizons so we already have monotonically increasing estimates and
906906
* the purpose of conservative estimates is not to let short term
907907
* fluctuations lower our estimates by too much.
908+
*
909+
* Note: In certain rare edge cases, monotonically increasing estimates may
910+
* not be guaranteed. Specifically, given two targets N and M, where M > N,
911+
* if a sub-estimate for target N fails to return a valid fee rate, while
912+
* target M has valid fee rate for that sub-estimate, target M may result
913+
* in a higher fee rate estimate than target N.
914+
*
915+
* See: https://github.com/bitcoin/bitcoin/issues/11800#issuecomment-349697807
908916
*/
909917
double halfEst = estimateCombinedFee(confTarget/2, HALF_SUCCESS_PCT, true, &tempResult);
910918
if (feeCalc) {

0 commit comments

Comments
 (0)