exchange

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

commit 82c392f568be5d3713550d451191d1d8d1745164
parent a5eb443ec0593602da72daf67b4f4ade77a98e92
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 28 Jun 2026 18:39:28 +0200

bugs

Diffstat:
Msrc/auditordb/update_reserve_info.c | 27+++++++++++++--------------
Msrc/exchangedb/select_kyc_accounts.c | 4++--
Msrc/json/json_helper.c | 4++--
Msrc/lib/exchange_api_get-management-keys.c | 4+++-
Msrc/lib/exchange_api_post-withdraw.c | 2+-
Msrc/mhd/mhd_spa.c | 20+++++++++-----------
6 files changed, 30 insertions(+), 31 deletions(-)

diff --git a/src/auditordb/update_reserve_info.c b/src/auditordb/update_reserve_info.c @@ -24,15 +24,11 @@ enum GNUNET_DB_QueryStatus -TALER_AUDITORDB_update_reserve_info (struct TALER_AUDITORDB_PostgresContext *pg, - const struct TALER_ReservePublicKeyP * - reserve_pub - , - const struct - TALER_AUDITORDB_ReserveFeeBalance * - rfb, - struct GNUNET_TIME_Timestamp - expiration_date) +TALER_AUDITORDB_update_reserve_info ( + struct TALER_AUDITORDB_PostgresContext *pg, + const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_AUDITORDB_ReserveFeeBalance *rfb, + struct GNUNET_TIME_Timestamp expiration_date) { struct GNUNET_PQ_QueryParam params[] = { TALER_PQ_query_param_amount (pg->conn, @@ -42,6 +38,8 @@ TALER_AUDITORDB_update_reserve_info (struct TALER_AUDITORDB_PostgresContext *pg, TALER_PQ_query_param_amount (pg->conn, &rfb->withdraw_fee_balance), TALER_PQ_query_param_amount (pg->conn, + &rfb->close_fee_balance), + TALER_PQ_query_param_amount (pg->conn, &rfb->purse_fee_balance), TALER_PQ_query_param_amount (pg->conn, &rfb->open_fee_balance), @@ -58,11 +56,12 @@ TALER_AUDITORDB_update_reserve_info (struct TALER_AUDITORDB_PostgresContext *pg, " reserve_balance=$1" ",reserve_loss=$2" ",withdraw_fee_balance=$3" - ",purse_fee_balance=$4" - ",open_fee_balance=$5" - ",history_fee_balance=$6" - ",expiration_date=$7" - " WHERE reserve_pub=$8"); + ",close_fee_balance=$4" + ",purse_fee_balance=$5" + ",open_fee_balance=$6" + ",history_fee_balance=$7" + ",expiration_date=$8" + " WHERE reserve_pub=$9"); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_update_reserve_info", params); diff --git a/src/exchangedb/select_kyc_accounts.c b/src/exchangedb/select_kyc_accounts.c @@ -190,7 +190,7 @@ TALER_EXCHANGEDB_select_kyc_accounts ( " AND ($3 OR (COALESCE(lo.to_investigate,FALSE) = $4))" // Account is open if we had an AML outcome " AND ($5 OR ((lo.outcome_serial_id IS NULL) = $6))" - " AND ($7 OR ((COALESCE((lo.jproperties ->>'high_risk')::bool,FALSE) = $8)))" + " AND ($7 OR ((COALESCE((lo.jproperties ->>'HIGH_RISK_CUSTOMER')::bool,FALSE) = $8)))" " ORDER BY kt.kyc_target_serial_id ASC" " LIMIT $2"); PREPARE (pg, @@ -221,7 +221,7 @@ TALER_EXCHANGEDB_select_kyc_accounts ( " AND ($3 OR (COALESCE(lo.to_investigate,FALSE) = $4))" // Account is open if we had an AML outcome " AND ($5 OR ((lo.outcome_serial_id IS NULL) = $6))" - " AND ($7 OR ((COALESCE((lo.jproperties ->>'high_risk')::bool,FALSE) = $8)))" + " AND ($7 OR ((COALESCE((lo.jproperties ->>'HIGH_RISK_CUSTOMER')::bool,FALSE) = $8)))" " ORDER BY kt.kyc_target_serial_id DESC" " LIMIT $2"); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, diff --git a/src/json/json_helper.c b/src/json/json_helper.c @@ -316,7 +316,7 @@ parse_cspec (void *cls, { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to parse %s at %u: %s\n", - spec[eline].field, + gspec[eline].field, eline, emsg); GNUNET_break_op (0); @@ -464,7 +464,7 @@ parse_denomination_group (void *cls, { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to parse %s at %u: %s\n", - spec[eline].field, + gspec[eline].field, eline, emsg); GNUNET_break_op (0); diff --git a/src/lib/exchange_api_get-management-keys.c b/src/lib/exchange_api_get-management-keys.c @@ -331,7 +331,9 @@ handle_get_keys_finished (void *cls, } else { - response_code = 0; + GNUNET_break_op (0); + gkr.hr.http_status = 0; + gkr.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED; } break; case MHD_HTTP_NOT_FOUND: diff --git a/src/lib/exchange_api_post-withdraw.c b/src/lib/exchange_api_post-withdraw.c @@ -895,7 +895,7 @@ prepare_coins ( wh->bp_coins[cs_coin_idx].candidate = can; wh->bp_coins[cs_coin_idx].planchet = planchet; wh->bp_coins[cs_coin_idx].denom_pub = &cd->denom_pub.key; - wh->bp_coins[cs_coin_idx].cs_idx = i; + wh->bp_coins[cs_coin_idx].cs_idx = cs_coin_idx; wh->bp_coins[cs_coin_idx].age_denom = age_denom; cs_coin_idx++; break; diff --git a/src/mhd/mhd_spa.c b/src/mhd/mhd_spa.c @@ -200,11 +200,7 @@ build_webui (void *cls, ext = strrchr (fn, '.'); if (NULL == ext) - { - GNUNET_break (0 == close (fd)); - GNUNET_free (fn); - return GNUNET_OK; - } + goto skip; if (0 == strcmp (ext, ".gz")) { @@ -212,6 +208,8 @@ build_webui (void *cls, ct = TALER_MHD_CT_GZIP; *ext = '\0'; ext = strrchr (fn, '.'); + if (NULL == ext) + goto skip; } if (0 == strcmp (ext, ".zstd")) @@ -220,12 +218,8 @@ build_webui (void *cls, ct = TALER_MHD_CT_ZSTD; *ext = '\0'; ext = strrchr (fn, '.'); - } - if (NULL == ext) - { - GNUNET_break (0 == close (fd)); - GNUNET_free (fn); - return GNUNET_OK; + if (NULL == ext) + goto skip; } ext++; @@ -292,6 +286,10 @@ build_webui (void *cls, w->responses[ct] = response; } return GNUNET_OK; +skip: + GNUNET_break (0 == close (fd)); + GNUNET_free (fn); + return GNUNET_OK; }