From 372ca14fbe0e716c789b74b766a8532f0f174268 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Sat, 12 Oct 2024 21:26:49 +0100 Subject: [PATCH] fees: document non-monotonic estimation edge case Closes: #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. --- src/policy/fees.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index a17faa3b99..df11aced9a 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -902,6 +902,12 @@ CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, FeeCalculation * horizons so we already have monotonically increasing estimates and * the purpose of conservative estimates is not to let short term * fluctuations lower our estimates by too much. + * + * Note: Monotonically increasing estimates are not guaranteed in certain + * data-sparse scenarios. In particular, if estimateCombinedFee returns no + * valid data (-1) for some estimates for a lower target, but does return + * valid data for a higher target, the estimate can theoretically return a + * higher value for higher targets. */ double halfEst = estimateCombinedFee(confTarget/2, HALF_SUCCESS_PCT, true, &tempResult); if (feeCalc) {