exchange

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

commit 5d579f975b92a0f9a49f71d0740c6e95b49fa32b
parent 52d8d704bb2a1ad3144bdb69b27d31317b74ce0b
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 11 Oct 2026 14:09:58 +0200

check 'ret' and handle instead of GNUNET_break-ing on it

Diffstat:
Msrc/exchange/taler-exchange-httpd_post-withdraw.c | 27++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_post-withdraw.c b/src/exchange/taler-exchange-httpd_post-withdraw.c @@ -533,20 +533,29 @@ phase_run_transaction ( struct WithdrawContext *wc) { enum MHD_Result mhd_ret; - enum GNUNET_GenericReturnValue qs; + enum GNUNET_GenericReturnValue ret; GNUNET_assert (WITHDRAW_PHASE_RUN_TRANSACTION == wc->phase); - qs = TEH_DB_run_transaction (wc->rc->connection, - "run withdraw", - TEH_MT_REQUEST_WITHDRAW, - &mhd_ret, - &withdraw_transaction, - wc); + ret = TEH_DB_run_transaction (wc->rc->connection, + "run withdraw", + TEH_MT_REQUEST_WITHDRAW, + &mhd_ret, + &withdraw_transaction, + wc); + /* If the transaction has changed the phase, we don't alter it and return.*/ if (WITHDRAW_PHASE_RUN_TRANSACTION != wc->phase) return; - GNUNET_break (GNUNET_OK == qs); - /* If the transaction has changed the phase, we don't alter it and return.*/ + if (GNUNET_OK != ret) + { + /* The transaction failed without setting an error phase (preflight, + start, hard commit failure or too many soft failures); a response + was already queued by TEH_DB_run_transaction(). */ + GNUNET_break (0); + finish_loop (wc, + mhd_ret); + return; + } wc->phase++; }