|
|
|
@ -2777,17 +2777,12 @@ CAmount CWallet::GetRequiredFee(unsigned int nTxBytes)
@@ -2777,17 +2777,12 @@ CAmount CWallet::GetRequiredFee(unsigned int nTxBytes)
|
|
|
|
|
return std::max(minTxFee.GetFee(nTxBytes), ::minRelayTxFee.GetFee(nTxBytes)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool, const CBlockPolicyEstimator& estimator) |
|
|
|
|
CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool, const CBlockPolicyEstimator& estimator, bool ignoreUserSetFee) |
|
|
|
|
{ |
|
|
|
|
// payTxFee is the user-set global for desired feerate
|
|
|
|
|
return GetMinimumFee(nTxBytes, nConfirmTarget, pool, estimator, payTxFee.GetFee(nTxBytes)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool, const CBlockPolicyEstimator& estimator, CAmount targetFee) |
|
|
|
|
{ |
|
|
|
|
CAmount nFeeNeeded = targetFee; |
|
|
|
|
CAmount nFeeNeeded = payTxFee.GetFee(nTxBytes); |
|
|
|
|
// User didn't set: use -txconfirmtarget to estimate...
|
|
|
|
|
if (nFeeNeeded == 0) { |
|
|
|
|
if (nFeeNeeded == 0 || ignoreUserSetFee) { |
|
|
|
|
int estimateFoundTarget = nConfirmTarget; |
|
|
|
|
nFeeNeeded = estimator.estimateSmartFee(nConfirmTarget, &estimateFoundTarget, pool).GetFee(nTxBytes); |
|
|
|
|
// ... unless we don't have enough mempool data for estimatefee, then use fallbackFee
|
|
|
|
|