diff options
author | TheCharlatan <seb.kung@gmail.com> | 2024-01-18 20:23:48 +0100 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2024-02-15 14:37:01 +0100 |
commit | 84f5c135b8118cbe15b8bfb4db80d61237987f64 (patch) | |
tree | 582c81822878c575620436e51f53739eb558ae3e /src/rpc/fees.cpp | |
parent | 473dd4b97ae40e43e1a1a97fdbeb40be4855e9bc (diff) | |
download | bitcoin-84f5c135b8118cbe15b8bfb4db80d61237987f64.tar.xz |
refactor: De-globalize g_signals
Diffstat (limited to 'src/rpc/fees.cpp')
-rw-r--r-- | src/rpc/fees.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/rpc/fees.cpp b/src/rpc/fees.cpp index 57ba486ed9..f3345b4f1c 100644 --- a/src/rpc/fees.cpp +++ b/src/rpc/fees.cpp @@ -4,6 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <core_io.h> +#include <node/context.h> #include <policy/feerate.h> #include <policy/fees.h> #include <rpc/protocol.h> @@ -21,10 +22,6 @@ #include <cmath> #include <string> -namespace node { -struct NodeContext; -} - using node::NodeContext; static RPCHelpMan estimatesmartfee() @@ -68,7 +65,7 @@ static RPCHelpMan estimatesmartfee() const NodeContext& node = EnsureAnyNodeContext(request.context); const CTxMemPool& mempool = EnsureMemPool(node); - SyncWithValidationInterfaceQueue(); + CHECK_NONFATAL(mempool.m_signals)->SyncWithValidationInterfaceQueue(); unsigned int max_target = fee_estimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE); unsigned int conf_target = ParseConfirmTarget(request.params[0], max_target); bool conservative = true; @@ -156,8 +153,9 @@ static RPCHelpMan estimaterawfee() [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue { CBlockPolicyEstimator& fee_estimator = EnsureAnyFeeEstimator(request.context); + const NodeContext& node = EnsureAnyNodeContext(request.context); - SyncWithValidationInterfaceQueue(); + CHECK_NONFATAL(node.validation_signals)->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; |