aboutsummaryrefslogtreecommitdiff
path: root/src/qt/coincontroldialog.cpp
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2016-12-13 16:38:43 -0500
committerAlex Morcos <morcos@chaincode.com>2017-06-14 15:34:19 -0400
commit61718268b5067acd1b8af4a4e94b1bf60334e1f7 (patch)
tree579f450c72b400fa6a41d3a3269567f044dfb04c /src/qt/coincontroldialog.cpp
parent228c319a944b0ba7c835b1909ee1c2056c652eb1 (diff)
Don't create change at the dust limit, even if it means paying more than expected
Diffstat (limited to 'src/qt/coincontroldialog.cpp')
-rw-r--r--src/qt/coincontroldialog.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp
index 06b599f3e2..dfcbaf3d9b 100644
--- a/src/qt/coincontroldialog.cpp
+++ b/src/qt/coincontroldialog.cpp
@@ -524,13 +524,10 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
CTxOut txout(nChange, (CScript)std::vector<unsigned char>(24, 0));
if (IsDust(txout, ::dustRelayFee))
{
- if (CoinControlDialog::fSubtractFeeFromAmount) // dust-change will be raised until no dust
- nChange = GetDustThreshold(txout, ::dustRelayFee);
- else
- {
- nPayFee += nChange;
- nChange = 0;
- }
+ nPayFee += nChange;
+ nChange = 0;
+ if (CoinControlDialog::fSubtractFeeFromAmount)
+ nBytes -= 34; // we didn't detect lack of change above
}
}