Skip to content

Commit 91504cb

Browse files
committed
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.
1 parent 7145239 commit 91504cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/rpc/fees.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <txmempool.h>
1515
#include <univalue.h>
1616
#include <util/fees.h>
17+
#include <validationinterface.h>
1718

1819
#include <algorithm>
1920
#include <array>
@@ -67,6 +68,7 @@ static RPCHelpMan estimatesmartfee()
6768
const NodeContext& node = EnsureAnyNodeContext(request.context);
6869
const CTxMemPool& mempool = EnsureMemPool(node);
6970

71+
SyncWithValidationInterfaceQueue();
7072
unsigned int max_target = fee_estimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE);
7173
unsigned int conf_target = ParseConfirmTarget(request.params[0], max_target);
7274
bool conservative = true;
@@ -155,6 +157,7 @@ static RPCHelpMan estimaterawfee()
155157
{
156158
CBlockPolicyEstimator& fee_estimator = EnsureAnyFeeEstimator(request.context);
157159

160+
SyncWithValidationInterfaceQueue();
158161
unsigned int max_target = fee_estimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE);
159162
unsigned int conf_target = ParseConfirmTarget(request.params[0], max_target);
160163
double threshold = 0.95;

0 commit comments

Comments
 (0)