exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 99574aca92b87cfce6318fa7d2c013ed98a6c64e
parent 05ccdf90d05557e1e0bfce542f57f00618fb0a27
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat, 10 Oct 2026 00:11:31 +0200

handle DB transaction failure correctly

Diffstat:
Msrc/exchange/taler-exchange-httpd_post-batch-deposit.c | 20+++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_post-batch-deposit.c b/src/exchange/taler-exchange-httpd_post-batch-deposit.c @@ -326,21 +326,23 @@ batch_deposit_transaction (void *cls, { struct TALER_MerchantWireHashP h_wire; - if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != - TALER_EXCHANGEDB_get_wire_hash_for_contract ( - TEH_pg, - &bd->merchant_pub, - &bd->h_contract_terms, - &h_wire)) + qs = TALER_EXCHANGEDB_get_wire_hash_for_contract ( + TEH_pg, + &bd->merchant_pub, + &bd->h_contract_terms, + &h_wire); + if (GNUNET_DB_STATUS_SOFT_ERROR == qs) + return qs; + if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs) { TALER_LOG_WARNING ( "Failed to retrieve conflicting contract details from database\n"); *mhd_ret = TALER_MHD_reply_with_error ( connection, MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "batch-deposit"); - return qs; + TALER_EC_GENERIC_DB_FETCH_FAILED, + "get_wire_hash_for_contract"); + return GNUNET_DB_STATUS_HARD_ERROR; } *mhd_ret