Skip to content

Commit

Permalink
don't produce dust change
Browse files Browse the repository at this point in the history
  • Loading branch information
backpacker69 committed Aug 5, 2019
1 parent d6ce566 commit 0788f17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/wallet.cpp
Expand Up @@ -2974,7 +2974,7 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
CAmount additionalFeeNeeded = nFeeNeeded - nFeeRet;
std::vector<CTxOut>::iterator change_position = txNew.vout.begin()+nChangePosInOut;
// Only reduce change if remaining amount is still a large enough output.
if (change_position->nValue >= MIN_FINAL_CHANGE + additionalFeeNeeded) {
if (change_position->nValue >= MIN_CHANGE + additionalFeeNeeded) {
change_position->nValue -= additionalFeeNeeded;
nFeeRet += additionalFeeNeeded;
break; // Done, able to increase fee from change
Expand Down

0 comments on commit 0788f17

Please sign in to comment.