aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2016-01-05 13:10:19 -0500
committerAlex Morcos <morcos@chaincode.com>2016-01-05 13:10:19 -0500
commit995b9f385b935e4e9b9fa46e82f642204cc85cba (patch)
tree16286b028619500855c74c624402503a0d7efe9e
parent605c17844ea32b6d237db6d83871164dc7d59dab (diff)
Always respect GetRequiredFee for wallet txs
-rw-r--r--src/wallet/wallet.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 444bd88f8b..244bc37e76 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2223,14 +2223,9 @@ CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarge
if (nFeeNeeded == 0) {
int estimateFoundTarget = nConfirmTarget;
nFeeNeeded = pool.estimateSmartFee(nConfirmTarget, &estimateFoundTarget).GetFee(nTxBytes);
- // ... unless we don't have enough mempool data for our desired target
- // so we make sure we're paying at least minTxFee
- if (nFeeNeeded == 0 || (unsigned int)estimateFoundTarget > nConfirmTarget)
- nFeeNeeded = std::max(nFeeNeeded, GetRequiredFee(nTxBytes));
- }
- // prevent user from paying a non-sense fee (like 1 satoshi): 0 < fee < minRelayFee
- if (nFeeNeeded < ::minRelayTxFee.GetFee(nTxBytes))
- nFeeNeeded = ::minRelayTxFee.GetFee(nTxBytes);
+ }
+ // prevent user from paying a fee below minRelayTxFee or minTxFee
+ nFeeNeeded = std::max(nFeeNeeded, GetRequiredFee(nTxBytes));
// But always obey the maximum
if (nFeeNeeded > maxTxFee)
nFeeNeeded = maxTxFee;