exchange

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

commit 8cc52ed1dce4be855194db8303fe7cfb472bae3b
parent 911d5a6ef721bf0add074ebaefee49d35000591e
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri,  3 Apr 2026 17:12:45 +0200

dead code elimination, add missing HTTP status code handlers

Diffstat:
Msrc/exchange/taler-exchange-httpd_post-management-global-fees.c | 5-----
Msrc/include/taler/taler-exchange/post-melt.h | 4+++-
Msrc/lib/exchange_api_post-management-keys.c | 7++++++-
Msrc/lib/exchange_api_post-management-wire-fee.c | 19-------------------
Msrc/lib/exchange_api_post-management-wire.c | 19++++---------------
Msrc/lib/exchange_api_post-melt.c | 8++++----
6 files changed, 17 insertions(+), 45 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_post-management-global-fees.c b/src/exchange/taler-exchange-httpd_post-management-global-fees.c @@ -63,11 +63,6 @@ struct AddFeeContext struct GNUNET_TIME_Relative purse_timeout; /** - * When does an account without KYC expire? - */ - struct GNUNET_TIME_Relative kyc_timeout; - - /** * When does an account history expire? */ struct GNUNET_TIME_Relative history_expiration; diff --git a/src/include/taler/taler-exchange/post-melt.h b/src/include/taler/taler-exchange/post-melt.h @@ -88,7 +88,9 @@ struct TALER_EXCHANGE_PostMeltResponse /** * The blinding seed that was used to get the blinding values. - * Might be NULL. + * Might be NULL. This is a value computed by the client + * library and not actually part of the response of the + * server. It is returned here for convenience. */ const struct TALER_BlindingMasterSeedP *blinding_seed; diff --git a/src/lib/exchange_api_post-management-keys.c b/src/lib/exchange_api_post-management-keys.c @@ -127,6 +127,10 @@ handle_post_keys_finished (void *cls, res.hr.ec = TALER_JSON_get_error_code (json); res.hr.hint = TALER_JSON_get_error_hint (json); break; + case MHD_HTTP_CONFLICT: + res.hr.ec = TALER_JSON_get_error_code (json); + res.hr.hint = TALER_JSON_get_error_hint (json); + break; case MHD_HTTP_REQUEST_ENTITY_TOO_LARGE: res.hr.ec = TALER_JSON_get_error_code (json); res.hr.hint = TALER_JSON_get_error_hint (json); @@ -168,7 +172,8 @@ TALER_EXCHANGE_post_management_keys_create ( pmkh->sign_sigs = GNUNET_memdup (pkd->sign_sigs, pkd->num_sign_sigs * sizeof (struct - TALER_EXCHANGE_SigningKeySignature)); + TALER_EXCHANGE_SigningKeySignature) + ); pmkh->denom_sigs = GNUNET_memdup (pkd->denom_sigs, pkd->num_denom_sigs * sizeof (struct diff --git a/src/lib/exchange_api_post-management-wire-fee.c b/src/lib/exchange_api_post-management-wire-fee.c @@ -125,29 +125,10 @@ handle_wire_fees_finished (void *cls, res.hr.ec = TALER_JSON_get_error_code (json); res.hr.hint = TALER_JSON_get_error_hint (json); break; - case MHD_HTTP_NOT_FOUND: - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Server did not find handler at `%s'. Did you configure the correct exchange base URL?\n", - pmwfh->url); - if (NULL != json) - { - res.hr.ec = TALER_JSON_get_error_code (json); - res.hr.hint = TALER_JSON_get_error_hint (json); - } - else - { - res.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE; - res.hr.hint = TALER_ErrorCode_get_hint (res.hr.ec); - } - break; case MHD_HTTP_CONFLICT: res.hr.ec = TALER_JSON_get_error_code (json); res.hr.hint = TALER_JSON_get_error_hint (json); break; - case MHD_HTTP_PRECONDITION_FAILED: - res.hr.ec = TALER_JSON_get_error_code (json); - res.hr.hint = TALER_JSON_get_error_hint (json); - break; default: /* unexpected response code */ GNUNET_break_op (0); diff --git a/src/lib/exchange_api_post-management-wire.c b/src/lib/exchange_api_post-management-wire.c @@ -156,24 +156,13 @@ handle_wire_finished (void *cls, break; case MHD_HTTP_NO_CONTENT: break; - case MHD_HTTP_FORBIDDEN: + case MHD_HTTP_BAD_REQUEST: res.hr.ec = TALER_JSON_get_error_code (json); res.hr.hint = TALER_JSON_get_error_hint (json); break; - case MHD_HTTP_NOT_FOUND: - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Server did not find handler at `%s'. Did you configure the correct exchange base URL?\n", - pmwh->url); - if (NULL != json) - { - res.hr.ec = TALER_JSON_get_error_code (json); - res.hr.hint = TALER_JSON_get_error_hint (json); - } - else - { - res.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE; - res.hr.hint = TALER_ErrorCode_get_hint (res.hr.ec); - } + case MHD_HTTP_FORBIDDEN: + res.hr.ec = TALER_JSON_get_error_code (json); + res.hr.hint = TALER_JSON_get_error_hint (json); break; case MHD_HTTP_CONFLICT: res.hr.ec = TALER_JSON_get_error_code (json); diff --git a/src/lib/exchange_api_post-melt.c b/src/lib/exchange_api_post-melt.c @@ -319,8 +319,8 @@ start_melt (struct TALER_EXCHANGE_PostMeltHandle *mh) TALER_EXCHANGE_get_melt_data (&mh->rms, mh->rd, mh->no_blinding_seed - ? NULL - : &mh->blinding_seed, + ? NULL + : &mh->blinding_seed, mh->melt_blinding_values, &mh->md)) { @@ -594,8 +594,8 @@ TALER_EXCHANGE_post_melt_start ( if (! mh->no_blinding_seed) { - struct TALER_EXCHANGE_NonceKey nks[GNUNET_NZL ( - mh->rd->num_fresh_denom_pubs)]; + struct TALER_EXCHANGE_NonceKey nks[ + GNUNET_NZL (mh->rd->num_fresh_denom_pubs)]; unsigned int nks_off = 0; for (unsigned int i = 0; i < mh->rd->num_fresh_denom_pubs; i++)