mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
Correctly randomize change output position
This commit is contained in:
parent
db3b4ade7b
commit
ac7b8ea086
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user