exchange

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

commit 659a701866ca9c04c9802624875f4b6dcf1ccc68
parent 2e6bedf7faeecdac7e3da70f5a8618a46feccf29
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Thu,  1 May 2025 13:11:47 +0200

-only stylistic fixes

Diffstat:
Msrc/exchange/taler-exchange-httpd_withdraw.c | 36+++++++++++++-----------------------
1 file changed, 13 insertions(+), 23 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_withdraw.c b/src/exchange/taler-exchange-httpd_withdraw.c @@ -320,6 +320,7 @@ struct WithdrawContext static struct WithdrawContext *wc_head; static struct WithdrawContext *wc_tail; + void TEH_withdraw_cleanup () { @@ -348,8 +349,8 @@ finish_loop (struct WithdrawContext *wc, MHD_RESULT mres) { wc->phase = (MHD_YES == mres) - ? WITHDRAW_PHASE_RETURN_YES - : WITHDRAW_PHASE_RETURN_NO; + ? WITHDRAW_PHASE_RETURN_YES + : WITHDRAW_PHASE_RETURN_NO; } @@ -375,11 +376,8 @@ withdraw_is_idempotent ( TEH_plugin->cls, &wc->request.withdraw.planchets_h, &wc->request.withdraw_idem); - - if (GNUNET_DB_STATUS_SOFT_ERROR == qs) - continue; - - break; + if (GNUNET_DB_STATUS_SOFT_ERROR != qs) + break; } if (0 > qs) @@ -457,7 +455,6 @@ withdraw_transaction ( "do_withdraw"); return qs; } - if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) { SET_ERROR (wc, @@ -533,19 +530,16 @@ phase_run_transaction ( 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); - if (GNUNET_OK != qs) - GNUNET_break (0); + GNUNET_break (GNUNET_OK == qs); /* If the transaction has changed the phase, we don't alter it and return.*/ - if (WITHDRAW_PHASE_RUN_TRANSACTION != wc->phase) + if (WITHDRAW_PHASE_RUN_TRANSACTION != wc->phase) return; - wc->phase++; } @@ -630,7 +624,9 @@ phase_prepare_transaction ( struct TEH_CsDeriveData cdds[num_cs_r_values]; struct GNUNET_CRYPTO_CsSessionNonce nonces[num_cs_r_values]; - memset (nonces, 0, sizeof(nonces)); + memset (nonces, + 0, + sizeof(nonces)); wc->request.withdraw.cs_r_values = GNUNET_new_array ( num_cs_r_values, @@ -655,8 +651,7 @@ phase_prepare_transaction ( } /** - * Let the crypto helper generate the R-values and - * make the choices. + * Let the crypto helper generate the R-values and make the choices. */ if (TALER_EC_NONE != TEH_keys_denomination_cs_batch_r_pub_simple ( @@ -776,9 +771,7 @@ withdraw_amount_cb ( ret = cb (cb_cls, &wc->request.withdraw.amount_with_fee, wc->now.abs_time); - GNUNET_break (GNUNET_SYSERR != ret); - if (GNUNET_OK != ret) return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS; @@ -788,14 +781,11 @@ withdraw_amount_cb ( limit, cb, cb_cls); - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got %d additional transactions for this withdrawal and limit %llu\n", qs, (unsigned long long) limit.abs_value_us); - GNUNET_break (qs >= 0); - return qs; } @@ -1299,8 +1289,8 @@ phase_generate_reply_error ( struct WithdrawContext *wc) { GNUNET_assert (WITHDRAW_PHASE_GENERATE_REPLY_ERROR == wc->phase); - if (IDEMPOTENCY_CHECK_REQUIRED (wc->error.code) - && withdraw_is_idempotent (wc)) + if (IDEMPOTENCY_CHECK_REQUIRED (wc->error.code) && + withdraw_is_idempotent (wc)) { return; }