aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-01-30 13:56:35 -0500
committerGavin Andresen <gavinandresen@gmail.com>2013-01-30 13:56:35 -0500
commitac7b8ea0864e925b0f5cf487be9acdf4a5d0c487 (patch)
tree3c0d3a6224124735341730bc2b2b0c8937408e5d
parentdb3b4ade7ba8a91afaa649177d5f297f20eb40fd (diff)
Correctly randomize change output position
-rw-r--r--src/wallet.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 557784e5c2..b8ef2a20bf 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