From 18476423fba5d2cadd2b0973e425a6ebedeb66a4 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Fri, 28 Apr 2017 17:22:37 -0400 Subject: [Wallet] unset change position when there is no change on exact match --- src/wallet/wallet.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/wallet/wallet.cpp') diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 1b59c3cd8..3e93a56d5 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2587,9 +2587,10 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt vector::iterator position = txNew.vout.begin()+nChangePosInOut; txNew.vout.insert(position, newTxOut); } - } - else + } else { reservekey.ReturnKey(); + nChangePosInOut = -1; + } // Fill vin // -- cgit v1.2.3