Browse Source

Correctly randomize change output position

0.8
Gavin Andresen 12 years ago
parent
commit
ac7b8ea086
  1. 2
      src/wallet.cpp

2
src/wallet.cpp

@ -1190,7 +1190,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW
scriptChange.SetDestination(vchPubKey.GetID()); scriptChange.SetDestination(vchPubKey.GetID());
// Insert change txn at random position: // 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)); wtxNew.vout.insert(position, CTxOut(nChange, scriptChange));
} }
else else

Loading…
Cancel
Save