mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-13 22:41:25 +02:00
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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user