<p>See <a href="https://github.com/bitcoin/bitcoin/blob/v0.11.0/src/wallet/wallet.cpp#L1855-L1875" rel="nofollow">these lines</a>:</p>

<pre><code>// 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 &gt; 0 &amp;&amp; newTxOut.IsDust(::minRelayTxFee))
{
    CAmount nDust = newTxOut.GetDustThreshold(::minRelayTxFee) - newTxOut.nValue;
    newTxOut.nValue += nDust; // raise change until no more dust
    for (unsigned int i = 0; i &lt; vecSend.size(); i++) // subtract from first recipient
    {
        if (vecSend[i].fSubtractFeeFromAmount)
        {
            txNew.vout[i].nValue -= nDust;
            if (txNew.vout[i].IsDust(::minRelayTxFee))
            {
                strFailReason = _("The transaction amount is too small to send after the fee has been deducted");
                return false;
            }
            break;
        }
    }
}
</code></pre>

<p>So Bitcoin core will give slightly less to the recipient rather than spend more than the payer originally requested, in the case of a dust-change output. </p>

CC BY-SA 3.0
2015-09-01T11:59:36.853Z
Then there's the question of whether or not this is a good policy... I don't believe it is. I think that as infrequently as dust change happens, just let miners have it and get a slightly faster confirmation time.
morsecoder
CC BY-SA 3.0
2015-09-02T04:00:52.420Z
It might not be good network policy, but it doesn't seem like users have an incentive to destroy dust UTXO's sent to them.
Nick ODell
CC BY-SA 3.0
2015-09-01T11:58:42.400Z
2015-09-01T11:58:42.400Z
morsecoder
<p>Bitcoin Core actually creates a minimum change of <code>0.01 BTC</code> (if it has sufficient funds), if it can't produce a direct match.</p>

<p>In the rare case that it doesn't have sufficient funds to produce a non-dust change output, it will do the weird stuff Stephen mentions.</p>

CC BY-SA 3.0
2016-10-19T22:57:25.460Z
2016-10-19T22:57:25.460Z
Murch
<p><a href="https://bitcoin.stackexchange.com/q/1077/5406">Bitcoin Core's Coin Selection</a> optimizes for minimal change outputs. How does Bitcoin Core prevent Change outputs of sizes below dust threshold from occurring?</p>

CC BY-SA 3.0
2016-10-19T22:55:55.270Z
This question is wrong, as Bitcoin Core actually creates a minimum change of 0.01 BTC, if it can't produce a direct match.
Murch
<transactions><dust><fragmentation><coin-selection>
How does Bitcoin Core's Coin Selection prevent change to be a dust output?
Murch
# How does Bitcoin Core's Coin Selection prevent change to be a dust output?

(Asked by: username_0 on 2015-09-01)

[Bitcoin Core's Coin Selection](https://bitcoin.stackexchange.com/q/1077/5406) optimizes for minimal change outputs. How does Bitcoin Core prevent Change outputs of sizes below dust threshold from occurring?

**Tags:** transactions, dust, fragmentation, coin-selection

> **Comments:**
> **username_0**: This question is wrong, as Bitcoin Core actually creates a minimum change of 0.01 BTC, if it can't produce a direct match.  

---

## 2 answers

### Answer by username_1 on 2015-09-01. Score: 2 | Accepted answer

See [these lines](https://github.com/bitcoin/bitcoin/blob/v0.11.0/src/wallet/wallet.cpp#L1855-L1875):

```
// 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 && newTxOut.IsDust(::minRelayTxFee))
{
    CAmount nDust = newTxOut.GetDustThreshold(::minRelayTxFee) - 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 (txNew.vout[i].IsDust(::minRelayTxFee))
            {
                strFailReason = _("The transaction amount is too small to send after the fee has been deducted");
                return false;
            }
            break;
        }
    }
}

```

So Bitcoin core will give slightly less to the recipient rather than spend more than the payer originally requested, in the case of a dust-change output.

> **Comments:**
> **username_1**: Then there's the question of whether or not this is a good policy... I don't believe it is. I think that as infrequently as dust change happens, just let miners have it and get a slightly faster confirmation time.  
> **username_2**: It might not be good network policy, but it doesn't seem like users have an incentive to destroy dust UTXO's sent to them.  

---

### Answer by username_0 on 2016-10-19. Score: 0

Bitcoin Core actually creates a minimum change of `0.01 BTC` (if it has sufficient funds), if it can't produce a direct match.

In the rare case that it doesn't have sufficient funds to produce a non-dust change output, it will do the weird stuff Stephen mentions.


---

