diff options
| author | Wladimir J. van der Laan <[email protected]> | 2017-06-22 17:55:51 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2017-06-22 18:23:11 +0200 |
| commit | 209eef60a9accc880480fea886c3668343d4749a (patch) | |
| tree | b73e4f692410bf8d3f1b7f843771e35a98fd7698 /src/qt/coincontroldialog.cpp | |
| parent | Merge #10530: Fix invalid instantiation and possibly unsafe accesses of array... (diff) | |
| parent | Don't create change at the dust limit, even if it means paying more than expe... (diff) | |
| download | discoin-209eef60a9accc880480fea886c3668343d4749a.tar.xz discoin-209eef60a9accc880480fea886c3668343d4749a.zip | |
Merge #9343: Don't create change at dust limit
6171826 Don't create change at the dust limit, even if it means paying more than expected (Alex Morcos)
Tree-SHA512: d4cf939b97a92d63d4703ad152093c9dc60e74af590697bc21adbcdf17fc9e6ffb37d46d5eefafbd69327d1bcb79911f1b826ce1d960d895d464c4408c4995c3
Diffstat (limited to 'src/qt/coincontroldialog.cpp')
| -rw-r--r-- | src/qt/coincontroldialog.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index b9da48ee1..c52cb43f3 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 } } |