exchange

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

commit ad210ea139f7238aea8b86ab7dbb82b8e3ee1c41
parent 6b609f35249702206dc5d34e0adb81f355eddcdb
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Thu,  1 May 2025 15:02:57 +0200

fix silly excessive scoping

Diffstat:
Msrc/exchange/taler-exchange-httpd_melt_v27.c | 60++++++++++++++++++++++++++++--------------------------------
1 file changed, 28 insertions(+), 32 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_melt_v27.c b/src/exchange/taler-exchange-httpd_melt_v27.c @@ -1128,42 +1128,38 @@ static void phase_generate_reply_success (struct MeltContext *mc) { struct TALER_EXCHANGEDB_Refresh_v27 *db_obj; + struct TALER_ExchangePublicKeyP pub; + struct TALER_ExchangeSignatureP sig; + enum TALER_ErrorCode ec_confirmation_sign; db_obj = mc->request.is_idempotent - ? &mc->request.refresh_idem - : &mc->request.refresh; - + ? &mc->request.refresh_idem + : &mc->request.refresh; + ec_confirmation_sign = + TALER_exchange_online_melt_confirmation_sign ( + &TEH_keys_exchange_sign_, + &db_obj->rc, + db_obj->noreveal_index, + &pub, + &sig); + if (TALER_EC_NONE != ec_confirmation_sign) { - struct TALER_ExchangePublicKeyP pub; - struct TALER_ExchangeSignatureP sig; - enum TALER_ErrorCode ec_confirmation_sign; - - ec_confirmation_sign = - TALER_exchange_online_melt_confirmation_sign ( - &TEH_keys_exchange_sign_, - &db_obj->rc, - db_obj->noreveal_index, - &pub, - &sig); - if (TALER_EC_NONE != ec_confirmation_sign) - { - SET_ERROR_WITH_FIELD (mc, - MELT_ERROR_CONFIRMATION_SIGN, - ec_confirmation_sign); - return; - } - - finish_loop (mc, - TALER_MHD_REPLY_JSON_PACK ( - mc->rc->connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_uint64 ("noreveal_index", - db_obj->noreveal_index), - GNUNET_JSON_pack_data_auto ("exchange_sig", - &sig), - GNUNET_JSON_pack_data_auto ("exchange_pub", - &pub))); + SET_ERROR_WITH_FIELD (mc, + MELT_ERROR_CONFIRMATION_SIGN, + ec_confirmation_sign); + return; } + + finish_loop (mc, + TALER_MHD_REPLY_JSON_PACK ( + mc->rc->connection, + MHD_HTTP_OK, + GNUNET_JSON_pack_uint64 ("noreveal_index", + db_obj->noreveal_index), + GNUNET_JSON_pack_data_auto ("exchange_sig", + &sig), + GNUNET_JSON_pack_data_auto ("exchange_pub", + &pub))); }