aboutsummaryrefslogtreecommitdiff
path: root/src/interface/node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interface/node.cpp')
-rw-r--r--src/interface/node.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/interface/node.cpp b/src/interface/node.cpp
index db03cc0627..1bd7e48b05 100644
--- a/src/interface/node.cpp
+++ b/src/interface/node.cpp
@@ -15,6 +15,9 @@
#include <net_processing.h>
#include <netaddress.h>
#include <netbase.h>
+#include <policy/feerate.h>
+#include <policy/fees.h>
+#include <policy/policy.h>
#include <primitives/block.h>
#include <rpc/server.h>
#include <scheduler.h>
@@ -29,6 +32,7 @@
#include <config/bitcoin-config.h>
#endif
#ifdef ENABLE_WALLET
+#include <wallet/fees.h>
#include <wallet/wallet.h>
#define CHECK_WALLET(x) x
#else
@@ -186,7 +190,31 @@ class NodeImpl : public Node
}
bool getNetworkActive() override { return g_connman && g_connman->GetNetworkActive(); }
unsigned int getTxConfirmTarget() override { CHECK_WALLET(return ::nTxConfirmTarget); }
+ CAmount getRequiredFee(unsigned int tx_bytes) override { CHECK_WALLET(return GetRequiredFee(tx_bytes)); }
+ CAmount getMinimumFee(unsigned int tx_bytes,
+ const CCoinControl& coin_control,
+ int* returned_target,
+ FeeReason* reason) override
+ {
+ FeeCalculation fee_calc;
+ CAmount result;
+ CHECK_WALLET(result = GetMinimumFee(tx_bytes, coin_control, ::mempool, ::feeEstimator, &fee_calc));
+ if (returned_target) *returned_target = fee_calc.returnedTarget;
+ if (reason) *reason = fee_calc.reason;
+ return result;
+ }
CAmount getMaxTxFee() override { return ::maxTxFee; }
+ CFeeRate estimateSmartFee(int num_blocks, bool conservative, int* returned_target = nullptr) override
+ {
+ FeeCalculation fee_calc;
+ CFeeRate result = ::feeEstimator.estimateSmartFee(num_blocks, &fee_calc, conservative);
+ if (returned_target) {
+ *returned_target = fee_calc.returnedTarget;
+ }
+ return result;
+ }
+ CFeeRate getDustRelayFee() override { return ::dustRelayFee; }
+ CFeeRate getPayTxFee() override { CHECK_WALLET(return ::payTxFee); }
UniValue executeRpc(const std::string& command, const UniValue& params, const std::string& uri) override
{
JSONRPCRequest req;