QT: Add bracket to not reassign values on non-tx

This commit is contained in:
Gregory Sanders 2019-04-17 11:16:17 -04:00
parent 88c256f751
commit 17229bfb8c

View file

@ -236,9 +236,10 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
std::vector<CAmount> out_amounts;
newTx = m_wallet->createTransaction(vecSend, coinControl, true /* sign */, nChangePosRet, nFeeRequired, out_amounts, strFailReason);
transaction.setTransactionFee(nFeeRequired);
if (fSubtractFeeFromAmount && newTx)
if (fSubtractFeeFromAmount && newTx) {
assert(out_amounts.size() == newTx->get().vout.size());
transaction.reassignAmounts(out_amounts, nChangePosRet);
}
if(!newTx)
{