aboutsummaryrefslogtreecommitdiff
path: root/src/node/interfaces.cpp
diff options
context:
space:
mode:
authorAntoine Poinsot <darosior@protonmail.com>2020-07-28 19:12:50 +0200
committerAntoine Poinsot <darosior@protonmail.com>2020-12-03 12:56:37 +0100
commit86ff2cf202bfb9d9b50800b8ffe3fead3f77f5fa (patch)
tree112793cb81c576520e0a4e7573556f239d95b87c /src/node/interfaces.cpp
parent03bfeee957ab7e3b6aece82b9561774648094f54 (diff)
downloadbitcoin-86ff2cf202bfb9d9b50800b8ffe3fead3f77f5fa.tar.xz
Remove the remaining fee estimation globals
This moves the CBlockPolicyEstimator to the NodeContext, which get rids of two globals and allows us to conditionally create the CBlockPolicyEstimator (and to remove a circular dep). Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Diffstat (limited to 'src/node/interfaces.cpp')
-rw-r--r--src/node/interfaces.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp
index 02c5cbc6b1..da3e759e38 100644
--- a/src/node/interfaces.cpp
+++ b/src/node/interfaces.cpp
@@ -592,11 +592,13 @@ public:
}
CFeeRate estimateSmartFee(int num_blocks, bool conservative, FeeCalculation* calc) override
{
- return ::feeEstimator.estimateSmartFee(num_blocks, calc, conservative);
+ if (!m_node.fee_estimator) return {};
+ return m_node.fee_estimator->estimateSmartFee(num_blocks, calc, conservative);
}
unsigned int estimateMaxBlocks() override
{
- return ::feeEstimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE);
+ if (!m_node.fee_estimator) return 0;
+ return m_node.fee_estimator->HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE);
}
CFeeRate mempoolMinFee() override
{