handle TALER_EXCHANGEDB_RO_EXCHANGE_TO_BANK in DB balance calulations

This commit is contained in:
Christian Grothoff 2017-04-03 15:37:33 +02:00
parent c9995bd758
commit 5b867c4b8e
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -781,6 +781,23 @@ execute_reserve_withdraw_transaction (struct MHD_Connection *connection,
} }
res |= 1; res |= 1;
break; break;
case TALER_EXCHANGEDB_RO_EXCHANGE_TO_BANK:
if (0 == (res & 2))
withdraw_total = pos->details.bank->amount;
else
if (GNUNET_OK !=
TALER_amount_add (&withdraw_total,
&withdraw_total,
&pos->details.bank->amount))
{
TEH_plugin->rollback (TEH_plugin->cls,
session);
return TEH_RESPONSE_reply_internal_db_error (connection,
TALER_EC_WITHDRAW_AMOUNT_WITHDRAWALS_OVERFLOW);
}
res |= 2;
break;
} }
} }
if (0 == (res & 1)) if (0 == (res & 1))