From ac7b8ea0864e925b0f5cf487be9acdf4a5d0c487 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Wed, 30 Jan 2013 13:56:35 -0500 Subject: Correctly randomize change output position --- src/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/wallet.cpp') 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 >& vecSend, CW scriptChange.SetDestination(vchPubKey.GetID()); // Insert change txn at random position: - vector::iterator position = wtxNew.vout.begin()+GetRandInt(wtxNew.vout.size()); + vector::iterator position = wtxNew.vout.begin()+GetRandInt(wtxNew.vout.size()+1); wtxNew.vout.insert(position, CTxOut(nChange, scriptChange)); } else -- cgit v1.2.3