Set val_imbalance in gnc_transaction_balance_trading.

When the code was refactored in 61973a8 the return value from the new
function gnc_transaction_get_commodity_imbalance was ignored.  This had
the effect of using an uninitialized variable to set the value in a new
trading account split that is not for the transaction's currency.  That
means that multicommodity transactions created with this bug and trading
accounts on will not be balanced.
This commit is contained in:
Mike Alexander 2015-11-17 02:25:37 -05:00
parent 9b3711533f
commit d4bbede08f

View File

@ -673,7 +673,7 @@ gnc_transaction_balance_trading (Transaction *trans, Account *root)
if (! gnc_commodity_equal (txn_curr, commodity))
{
gnc_transaction_get_commodity_imbalance (trans, commodity);
val_imbalance = gnc_transaction_get_commodity_imbalance (trans, commodity);
}
xaccTransBeginEdit (trans);