fees: add EstimateFeeRate and MaximumTarget to CBlockPolicyEstimator

Introduce that common interface:
- FeeRateEstimatorType identifies the source estimator in a result.
- FeeRateEstimation carries the feerate and returned target of a
  successful estimate; FeeRateEstimationError carries the error
  message alongside a zero-value estimation.
- EstimateFeeRate wraps estimateSmartFee and returns
  util::Expected<FeeRateEstimation, FeeRateEstimationError>.
- MaximumTarget delegates to HighestTargetTracked(LONG_HALFLIFE) so
  callers do not need to know about block policy horizons.

Update call sites in rpc/fees.cpp and node/interfaces.cpp.

A later commit introduces FeeRateEstimatorManager, which selects
between multiple fee rate estimators. To compare estimates and
report which estimator produced them, the manager needs each fee
rate estimator to expose a uniform output, whereas
estimateSmartFee's CFeeRate/FeeCalculation output is specific to
the block policy fee rate estimator.

Co-authored-by: willcl-ark <will@256k1.dev>
This commit is contained in:
ismaelsadeeq
2025-11-17 14:19:57 +00:00
parent 5adb2ab084
commit 2cb6b831e0
5 changed files with 77 additions and 5 deletions

View File

@@ -744,7 +744,7 @@ public:
unsigned int estimateMaxBlocks() override
{
if (!m_node.fee_estimator) return 0;
return m_node.fee_estimator->HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE);
return m_node.fee_estimator->MaximumTarget();
}
CFeeRate mempoolMinFee() override
{