diff options
| author | Gavin Andresen <[email protected]> | 2013-01-30 11:02:51 -0800 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2013-01-30 11:02:51 -0800 |
| commit | a078121373a3ab89df5ab0ed00d821ac66789842 (patch) | |
| tree | 3c0d3a6224124735341730bc2b2b0c8937408e5d /src/wallet.cpp | |
| parent | Merge pull request #2224 from sipa/valstate (diff) | |
| parent | Correctly randomize change output position (diff) | |
| download | discoin-a078121373a3ab89df5ab0ed00d821ac66789842.tar.xz discoin-a078121373a3ab89df5ab0ed00d821ac66789842.zip | |
Merge pull request #2246 from gavinandresen/changefix
Correctly randomize change output position
Diffstat (limited to 'src/wallet.cpp')
| -rw-r--r-- | src/wallet.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index 557784e5c..b8ef2a20b 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -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 |