diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2019-06-28 22:44:38 -0400 |
---|---|---|
committer | Sjors Provoost <sjors@sprovoost.nl> | 2019-06-28 22:44:38 -0400 |
commit | 806b0052c3b45415862f74f20ba5f389e5b673de (patch) | |
tree | f8acbb20ec282a28fb0eba331a4e81d6a75872e4 /src/wallet/fees.cpp | |
parent | 7400135b7918df9c34206bead744c496e07b0e78 (diff) |
[wallet] abort when attempting to fund a transaction above maxtxfee
FundTransaction calls GetMinimumFee which, when the fee rate is absurdly high, quietly reduced the fee to -maxtxfee. Becaue an absurdly high fee rate is usually the result of a fat finger, aborting seems safer behavior.
Diffstat (limited to 'src/wallet/fees.cpp')
-rw-r--r-- | src/wallet/fees.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/wallet/fees.cpp b/src/wallet/fees.cpp index ad69e84358..2792058f2a 100644 --- a/src/wallet/fees.cpp +++ b/src/wallet/fees.cpp @@ -18,14 +18,7 @@ CAmount GetRequiredFee(const CWallet& wallet, unsigned int nTxBytes) CAmount GetMinimumFee(const CWallet& wallet, unsigned int nTxBytes, const CCoinControl& coin_control, FeeCalculation* feeCalc) { - CAmount fee_needed = GetMinimumFeeRate(wallet, coin_control, feeCalc).GetFee(nTxBytes); - // Always obey the maximum - const CAmount max_tx_fee = wallet.m_default_max_tx_fee; - if (fee_needed > max_tx_fee) { - fee_needed = max_tx_fee; - if (feeCalc) feeCalc->reason = FeeReason::MAXTXFEE; - } - return fee_needed; + return GetMinimumFeeRate(wallet, coin_control, feeCalc).GetFee(nTxBytes); } CFeeRate GetRequiredFeeRate(const CWallet& wallet) |