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.
This commit is contained in:
1 parent
714523918b
commit
91504cbe0d
1 file changed
+3
@@ -14,6 +14,7 @@
|
|||||||
#include <txmempool.h>
|
#include <txmempool.h>
|
||||||
#include <univalue.h>
|
#include <univalue.h>
|
||||||
#include <util/fees.h>
|
#include <util/fees.h>
|
||||||
|
#include <validationinterface.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
@@ -67,6 +68,7 @@ static RPCHelpMan estimatesmartfee()
|
|||||||
const NodeContext& node = EnsureAnyNodeContext(request.context);
|
const NodeContext& node = EnsureAnyNodeContext(request.context);
|
||||||
const CTxMemPool& mempool = EnsureMemPool(node);
|
const CTxMemPool& mempool = EnsureMemPool(node);
|
||||||
|
|
||||||
|
SyncWithValidationInterfaceQueue();
|
||||||
unsigned int max_target = fee_estimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE);
|
unsigned int max_target = fee_estimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE);
|
||||||
unsigned int conf_target = ParseConfirmTarget(request.params[0], max_target);
|
unsigned int conf_target = ParseConfirmTarget(request.params[0], max_target);
|
||||||
bool conservative = true;
|
bool conservative = true;
|
||||||
@@ -155,6 +157,7 @@ static RPCHelpMan estimaterawfee()
|
|||||||
{
|
{
|
||||||
CBlockPolicyEstimator& fee_estimator = EnsureAnyFeeEstimator(request.context);
|
CBlockPolicyEstimator& fee_estimator = EnsureAnyFeeEstimator(request.context);
|
||||||
|
|
||||||
|
SyncWithValidationInterfaceQueue();
|
||||||
unsigned int max_target = fee_estimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE);
|
unsigned int max_target = fee_estimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE);
|
||||||
unsigned int conf_target = ParseConfirmTarget(request.params[0], max_target);
|
unsigned int conf_target = ParseConfirmTarget(request.params[0], max_target);
|
||||||
double threshold = 0.95;
|
double threshold = 0.95;
|
||||||
|
|||||||
Reference in new issue
Block a user