mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
wallet: Make fee settings non-static members
This commit is contained in:
@@ -191,20 +191,6 @@ 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
|
||||
{
|
||||
|
||||
@@ -26,11 +26,9 @@ class Coin;
|
||||
class RPCTimerInterface;
|
||||
class UniValue;
|
||||
class proxyType;
|
||||
enum class FeeReason;
|
||||
struct CNodeStateStats;
|
||||
|
||||
namespace interfaces {
|
||||
|
||||
class Handler;
|
||||
class Wallet;
|
||||
|
||||
@@ -152,18 +150,6 @@ public:
|
||||
//! Get network active.
|
||||
virtual bool getNetworkActive() = 0;
|
||||
|
||||
//! Get tx confirm target.
|
||||
virtual unsigned int getTxConfirmTarget() = 0;
|
||||
|
||||
//! Get required fee.
|
||||
virtual CAmount getRequiredFee(unsigned int tx_bytes) = 0;
|
||||
|
||||
//! Get minimum fee.
|
||||
virtual CAmount getMinimumFee(unsigned int tx_bytes,
|
||||
const CCoinControl& coin_control,
|
||||
int* returned_target,
|
||||
FeeReason* reason) = 0;
|
||||
|
||||
//! Get max tx fee.
|
||||
virtual CAmount getMaxTxFee() = 0;
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include <consensus/validation.h>
|
||||
#include <interfaces/handler.h>
|
||||
#include <net.h>
|
||||
#include <policy/feerate.h>
|
||||
#include <policy/fees.h>
|
||||
#include <policy/policy.h>
|
||||
#include <primitives/transaction.h>
|
||||
#include <script/ismine.h>
|
||||
@@ -20,6 +22,7 @@
|
||||
#include <uint256.h>
|
||||
#include <validation.h>
|
||||
#include <wallet/feebumper.h>
|
||||
#include <wallet/fees.h>
|
||||
#include <wallet/wallet.h>
|
||||
|
||||
namespace interfaces {
|
||||
@@ -403,6 +406,20 @@ public:
|
||||
}
|
||||
return result;
|
||||
}
|
||||
CAmount getRequiredFee(unsigned int tx_bytes) override { return GetRequiredFee(m_wallet, tx_bytes); }
|
||||
CAmount getMinimumFee(unsigned int tx_bytes,
|
||||
const CCoinControl& coin_control,
|
||||
int* returned_target,
|
||||
FeeReason* reason) override
|
||||
{
|
||||
FeeCalculation fee_calc;
|
||||
CAmount result;
|
||||
result = GetMinimumFee(m_wallet, tx_bytes, coin_control, ::mempool, ::feeEstimator, &fee_calc);
|
||||
if (returned_target) *returned_target = fee_calc.returnedTarget;
|
||||
if (reason) *reason = fee_calc.reason;
|
||||
return result;
|
||||
}
|
||||
unsigned int getConfirmTarget() override { return m_wallet.m_confirm_target; }
|
||||
bool hdEnabled() override { return m_wallet.IsHDEnabled(); }
|
||||
OutputType getDefaultAddressType() override { return m_wallet.m_default_address_type; }
|
||||
OutputType getDefaultChangeType() override { return m_wallet.m_default_change_type; }
|
||||
|
||||
@@ -22,8 +22,10 @@
|
||||
#include <vector>
|
||||
|
||||
class CCoinControl;
|
||||
class CFeeRate;
|
||||
class CKey;
|
||||
class CWallet;
|
||||
enum class FeeReason;
|
||||
enum class OutputType;
|
||||
struct CRecipient;
|
||||
|
||||
@@ -218,6 +220,18 @@ public:
|
||||
//! Return wallet transaction output information.
|
||||
virtual std::vector<WalletTxOut> getCoins(const std::vector<COutPoint>& outputs) = 0;
|
||||
|
||||
//! Get required fee.
|
||||
virtual CAmount getRequiredFee(unsigned int tx_bytes) = 0;
|
||||
|
||||
//! Get minimum fee.
|
||||
virtual CAmount getMinimumFee(unsigned int tx_bytes,
|
||||
const CCoinControl& coin_control,
|
||||
int* returned_target,
|
||||
FeeReason* reason) = 0;
|
||||
|
||||
//! Get tx confirm target.
|
||||
virtual unsigned int getConfirmTarget() = 0;
|
||||
|
||||
// Return whether HD enabled.
|
||||
virtual bool hdEnabled() = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user