From 91504cbe0de2b74ef1aa2709761aaf0597ec66a2 Mon Sep 17 00:00:00 2001 From: ismaelsadeeq Date: Wed, 8 Nov 2023 11:21:49 +0100 Subject: [PATCH] rpc: `SyncWithValidationInterfaceQueue` on fee estimation RPC's This ensures that the most recent fee estimation data is used for the fee estimation with `estimateSmartfee` and `estimaterawfee` RPC's. --- src/rpc/fees.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rpc/fees.cpp b/src/rpc/fees.cpp index 62396d4c589..57ba486ed90 100644 --- a/src/rpc/fees.cpp +++ b/src/rpc/fees.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -67,6 +68,7 @@ static RPCHelpMan estimatesmartfee() const NodeContext& node = EnsureAnyNodeContext(request.context); const CTxMemPool& mempool = EnsureMemPool(node); + SyncWithValidationInterfaceQueue(); unsigned int max_target = fee_estimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE); unsigned int conf_target = ParseConfirmTarget(request.params[0], max_target); bool conservative = true; @@ -155,6 +157,7 @@ static RPCHelpMan estimaterawfee() { CBlockPolicyEstimator& fee_estimator = EnsureAnyFeeEstimator(request.context); + SyncWithValidationInterfaceQueue(); unsigned int max_target = fee_estimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE); unsigned int conf_target = ParseConfirmTarget(request.params[0], max_target); double threshold = 0.95;