diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -558,13 +558,11 @@ CTxOut txout(nChange, static_cast(std::vector(24, 0))); if (IsDust(txout, model->node().getDustRelayFee())) { - // dust-change will be raised until no dust + nPayFee += nChange; + nChange = Amount::zero(); if (CoinControlDialog::fSubtractFeeFromAmount) { - nChange = GetDustThreshold( - txout, model->node().getDustRelayFee()); - } else { - nPayFee += nChange; - nChange = Amount::zero(); + // we didn't detect lack of change above + nBytes -= 34; } } } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3040,33 +3040,6 @@ // Fill a vout to ourself. CTxOut newTxOut(nChange, scriptChange); - // We do not move dust-change to fees, because the sender would - // end up paying more than requested. This would be against the - // purpose of the all-inclusive feature. So instead we raise the - // change and deduct from the recipient. - if (nSubtractFeeFromAmount > 0 && - IsDust(newTxOut, dustRelayFee)) { - Amount nDust = GetDustThreshold(newTxOut, dustRelayFee) - - newTxOut.nValue; - // Raise change until no more dust. - newTxOut.nValue += nDust; - // Subtract from first recipient. - for (unsigned int i = 0; i < vecSend.size(); i++) { - if (vecSend[i].fSubtractFeeFromAmount) { - txNew.vout[i].nValue -= nDust; - if (IsDust(txNew.vout[i], dustRelayFee)) { - strFailReason = - _("The transaction amount is too small " - "to send after the fee has been " - "deducted"); - return false; - } - - break; - } - } - } - // Never create dust outputs; if we would, just add the dust to // the fee. if (IsDust(newTxOut, dustRelayFee)) {