mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Remove uses of fee globals in wallet code
This commit does not change behavior.
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
|
||||
#include <chain.h>
|
||||
#include <chainparams.h>
|
||||
#include <policy/fees.h>
|
||||
#include <policy/policy.h>
|
||||
#include <policy/rbf.h>
|
||||
#include <primitives/block.h>
|
||||
#include <sync.h>
|
||||
@@ -214,6 +216,18 @@ public:
|
||||
return ::mempool.CalculateMemPoolAncestors(entry, ancestors, limit_ancestor_count, limit_ancestor_size,
|
||||
limit_descendant_count, limit_descendant_size, unused_error_string);
|
||||
}
|
||||
CFeeRate estimateSmartFee(int num_blocks, bool conservative, FeeCalculation* calc) override
|
||||
{
|
||||
return ::feeEstimator.estimateSmartFee(num_blocks, calc, conservative);
|
||||
}
|
||||
unsigned int estimateMaxBlocks() override
|
||||
{
|
||||
return ::feeEstimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE);
|
||||
}
|
||||
CFeeRate mempoolMinFee() override
|
||||
{
|
||||
return ::mempool.GetMinFee(gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -19,6 +19,7 @@ class CScheduler;
|
||||
class CTransaction;
|
||||
class uint256;
|
||||
struct CBlockLocator;
|
||||
struct FeeCalculation;
|
||||
|
||||
namespace interfaces {
|
||||
|
||||
@@ -145,6 +146,15 @@ public:
|
||||
|
||||
//! Check chain limits.
|
||||
virtual bool checkChainLimits(CTransactionRef tx) = 0;
|
||||
|
||||
//! Estimate smart fee.
|
||||
virtual CFeeRate estimateSmartFee(int num_blocks, bool conservative, FeeCalculation* calc = nullptr) = 0;
|
||||
|
||||
//! Fee estimator max target.
|
||||
virtual unsigned int estimateMaxBlocks() = 0;
|
||||
|
||||
//! Pool min fee.
|
||||
virtual CFeeRate mempoolMinFee() = 0;
|
||||
};
|
||||
|
||||
//! Interface to let node manage chain clients (wallets, or maybe tools for
|
||||
|
||||
@@ -457,7 +457,7 @@ public:
|
||||
{
|
||||
FeeCalculation fee_calc;
|
||||
CAmount result;
|
||||
result = GetMinimumFee(*m_wallet, tx_bytes, coin_control, ::mempool, ::feeEstimator, &fee_calc);
|
||||
result = GetMinimumFee(*m_wallet, tx_bytes, coin_control, &fee_calc);
|
||||
if (returned_target) *returned_target = fee_calc.returnedTarget;
|
||||
if (reason) *reason = fee_calc.reason;
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user