diff options
| author | Alex Morcos <[email protected]> | 2016-12-13 16:38:43 -0500 |
|---|---|---|
| committer | Alex Morcos <[email protected]> | 2017-06-14 15:34:19 -0400 |
| commit | 61718268b5067acd1b8af4a4e94b1bf60334e1f7 (patch) | |
| tree | 579f450c72b400fa6a41d3a3269567f044dfb04c /src/wallet/wallet.cpp | |
| parent | Merge #9895: Turn TryCreateDirectory() into TryCreateDirectories() (diff) | |
| download | discoin-61718268b5067acd1b8af4a4e94b1bf60334e1f7.tar.xz discoin-61718268b5067acd1b8af4a4e94b1bf60334e1f7.zip | |
Don't create change at the dust limit, even if it means paying more than expected
Diffstat (limited to 'src/wallet/wallet.cpp')
| -rw-r--r-- | src/wallet/wallet.cpp | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 02de3ccee..af75906ae 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2633,28 +2633,6 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT 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)) - { - CAmount nDust = GetDustThreshold(newTxOut, ::dustRelayFee) - newTxOut.nValue; - newTxOut.nValue += nDust; // raise change until no more dust - for (unsigned int i = 0; i < vecSend.size(); i++) // subtract from first recipient - { - 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)) |