CreateTransaction: Remove change adjustment functionality for now

This commit is contained in:
Gregory Sanders 2017-06-07 11:35:13 -04:00
parent 1dac6c2aa2
commit 08d9700c96

View file

@ -3227,6 +3227,7 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& 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<CRecipient>& vecSend, CWalletTx& wt
vector<CTxOut>::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<CRecipient>& 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<CRecipient>& vecSend, CWalletTx& wt
}
}
// TODO Do actual blinding/caching here to allow for amount adjustments until end
if (sign)
{
CTransaction txNewConst(txNew);