From 08d9700c96d7d3cf8f0e4b91bd52e02fbe2078ca Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Wed, 7 Jun 2017 11:35:13 -0400 Subject: [PATCH] CreateTransaction: Remove change adjustment functionality for now --- src/wallet/wallet.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 73980bd790..d82156fe03 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3227,6 +3227,7 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt } if (nFeeRet >= nFeeNeeded) { + /* TODO Push actual blinding outside of loop and reactivate this logic // Reduce fee to only the needed amount if we have change // output to increase. This prevents potential overpayment // in fees if the coins selected to meet nFeeNeeded result @@ -3242,10 +3243,10 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt vector::iterator change_position = txNew.vout.begin()+nChangePosInOut; change_position->nValue = CConfidentialValue(change_position->nValue.GetAmount() + extraFeePaid); nFeeRet -= extraFeePaid; - } + } */ break; // Done, enough fee included. } - + /* TODO Push actual blinding outside of loop and reactivate this logic // Try to reduce change to include necessary fee if (nChangePosInOut != -1 && nSubtractFeeFromAmount == 0) { CAmount additionalFeeNeeded = nFeeNeeded - nFeeRet; @@ -3256,7 +3257,7 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt nFeeRet += additionalFeeNeeded; break; // Done, able to increase fee from change } - } + }*/ // Include more fee and try again. nFeeRet = nFeeNeeded; @@ -3264,6 +3265,7 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt } } + // TODO Do actual blinding/caching here to allow for amount adjustments until end if (sign) { CTransaction txNewConst(txNew);