diff options
author | Cozz Lovan <cozzlovan@yahoo.com> | 2014-11-02 18:28:43 +0100 |
---|---|---|
committer | Cozz Lovan <cozzlovan@yahoo.com> | 2014-11-19 16:04:53 +0100 |
commit | e7876b297901a4b49daafc9ccd2b5c34a6214039 (patch) | |
tree | 56d4ec3933332a6e51ebb74f853a9ff948d9d37c /src/wallet.cpp | |
parent | ed3e5e468c5b7973d71efe51c90c3a301d570e27 (diff) |
[Wallet] Prevent user from paying a non-sense fee
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r-- | src/wallet.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index f1cf104974..2d59506bab 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1633,6 +1633,9 @@ CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarge { // payTxFee is user-set "I want to pay this much" CAmount nFeeNeeded = payTxFee.GetFee(nTxBytes); + // prevent user from paying a non-sense fee (like 1 satoshi): 0 < fee < minRelayFee + if (nFeeNeeded > 0 && nFeeNeeded < ::minRelayTxFee.GetFee(nTxBytes)) + nFeeNeeded = ::minRelayTxFee.GetFee(nTxBytes); // User didn't set: use -txconfirmtarget to estimate... if (nFeeNeeded == 0) nFeeNeeded = pool.estimateFee(nConfirmTarget).GetFee(nTxBytes); |