diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-10-06 20:54:42 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-10-06 20:54:42 +0200 |
commit | dbab0c658734c14436a89bd7fc76b295cbcf5448 (patch) | |
tree | 45c76147c8da84a4a9911803fca54744aa36725a /src/exchange/taler-exchange-httpd_db.c | |
parent | 2f715c27f82584cb65855785144877da628fe35c (diff) | |
download | exchange-dbab0c658734c14436a89bd7fc76b295cbcf5448.tar.gz exchange-dbab0c658734c14436a89bd7fc76b295cbcf5448.tar.bz2 exchange-dbab0c658734c14436a89bd7fc76b295cbcf5448.zip |
check return value from TALER_amount_get_zero
Diffstat (limited to 'src/exchange/taler-exchange-httpd_db.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_db.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/exchange/taler-exchange-httpd_db.c b/src/exchange/taler-exchange-httpd_db.c index f2e1f7b39..30bc33e17 100644 --- a/src/exchange/taler-exchange-httpd_db.c +++ b/src/exchange/taler-exchange-httpd_db.c @@ -39,7 +39,7 @@ * attempts to commit the transaction. Upon soft failures, * retries @a cb a few times. Upon hard or persistent soft * errors, generates an error message for @a connection. - * + * * @param connection MHD connection to run @a cb for * @param[out] set to MHD response code, if transaction failed * @param cb callback implementing transaction logic @@ -68,13 +68,13 @@ TEH_DB_run_transaction (struct MHD_Connection *connection, { enum GNUNET_DB_QueryStatus qs; - if (GNUNET_OK != - TEH_plugin->start (TEH_plugin->cls, - session)) - { + if (GNUNET_OK != + TEH_plugin->start (TEH_plugin->cls, + session)) + { GNUNET_break (0); if (NULL != mhd_ret) - *mhd_ret = TEH_RESPONSE_reply_internal_db_error (connection, + *mhd_ret = TEH_RESPONSE_reply_internal_db_error (connection, TALER_EC_DB_START_FAILED); return GNUNET_SYSERR; } @@ -84,12 +84,12 @@ TEH_DB_run_transaction (struct MHD_Connection *connection, mhd_ret); if (0 > qs) TEH_plugin->rollback (TEH_plugin->cls, - session); + session); if (GNUNET_DB_STATUS_HARD_ERROR == qs) return GNUNET_SYSERR; if (0 <= qs) qs = TEH_plugin->commit (TEH_plugin->cls, - session); + session); if (GNUNET_DB_STATUS_HARD_ERROR == qs) { if (NULL != mhd_ret) @@ -132,8 +132,9 @@ TEH_DB_calculate_transaction_list_totals (struct TALER_EXCHANGEDB_TransactionLis struct TALER_EXCHANGEDB_TransactionList *pos; struct TALER_Amount refunded; - TALER_amount_get_zero (spent.currency, - &refunded); + GNUNET_assert (GNUNET_OK == + TALER_amount_get_zero (spent.currency, + &refunded)); for (pos = tl; NULL != pos; pos = pos->next) { switch (pos->type) |