Skip to content

Commit

Permalink
Merge pull request bitcoin#2246 from gavinandresen/changefix
Browse files Browse the repository at this point in the history
Correctly randomize change output position
  • Loading branch information
gavinandresen committed Jan 30, 2013
2 parents db3b4ad + ac7b8ea commit a078121
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet.cpp
Expand Up @@ -1190,7 +1190,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW
scriptChange.SetDestination(vchPubKey.GetID());

// Insert change txn at random position:
vector<CTxOut>::iterator position = wtxNew.vout.begin()+GetRandInt(wtxNew.vout.size());
vector<CTxOut>::iterator position = wtxNew.vout.begin()+GetRandInt(wtxNew.vout.size()+1);
wtxNew.vout.insert(position, CTxOut(nChange, scriptChange));
}
else
Expand Down

0 comments on commit a078121

Please sign in to comment.