diff options
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/fees.cpp | 8 | ||||
-rw-r--r-- | src/wallet/wallet.cpp | 5 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/wallet/fees.cpp b/src/wallet/fees.cpp index d620e25f2b..0cac42ba72 100644 --- a/src/wallet/fees.cpp +++ b/src/wallet/fees.cpp @@ -21,13 +21,7 @@ CAmount GetRequiredFee(const CWallet& wallet, unsigned int nTxBytes) CAmount GetMinimumFee(const CWallet& wallet, unsigned int nTxBytes, const CCoinControl& coin_control, const CTxMemPool& pool, const CBlockPolicyEstimator& estimator, FeeCalculation* feeCalc) { - CAmount fee_needed = GetMinimumFeeRate(wallet, coin_control, pool, estimator, feeCalc).GetFee(nTxBytes); - // Always obey the maximum - if (fee_needed > maxTxFee) { - fee_needed = maxTxFee; - if (feeCalc) feeCalc->reason = FeeReason::MAXTXFEE; - } - return fee_needed; + return GetMinimumFeeRate(wallet, coin_control, pool, estimator, feeCalc).GetFee(nTxBytes); } CFeeRate GetRequiredFeeRate(const CWallet& wallet) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 8d52f7eeca..d5f5df381a 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3075,6 +3075,11 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CTransac } } + if (nFeeRet > maxTxFee) { + strFailReason = _("Fee exceeds maximum configured by -maxtxfee"); + return false; + } + if (gArgs.GetBoolArg("-walletrejectlongchains", DEFAULT_WALLET_REJECT_LONG_CHAINS)) { // Lastly, ensure this tx will pass the mempool's chain limits LockPoints lp; |