Skip to content

Commit

Permalink
Update wallet.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueDragon747 committed Mar 6, 2022
1 parent 95239c1 commit 1db01f3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/wallet.cpp
Expand Up @@ -1270,8 +1270,11 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend,
// add the dust to the fee.
if (newTxOut.IsDust())
{
nFeeRet += nChange;
reservekey.ReturnKey();
// Insert change txn at random position:
vector<CTxOut>::iterator position = wtxNew.vout.begin()+GetRandInt(wtxNew.vout.size()+1);
wtxNew.vout.insert(position, newTxOut);
// nFeeRet += nChange;
// reservekey.ReturnKey();
}
else
{
Expand Down

0 comments on commit 1db01f3

Please sign in to comment.