exchange

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

commit b0ffd34b9d7ad3b04c23500d558f6688c1ae3f90
parent fa29502ba2b6f4c82ebdacdd2d24a8db0f7fe61c
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 25 Mar 2026 22:44:44 +0100

only return denominations in /keys that can still be deposited (#11309)

Diffstat:
Msrc/exchange/taler-exchange-httpd_keys.c | 9++++++++-
Msrc/exchangedb/pg_iterate_denominations.c | 6+++++-
2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c @@ -1905,6 +1905,12 @@ denomination_info_cb ( struct TEH_KeyStateHandle *ksh = cls; struct TEH_DenominationKey *dk; + if (GNUNET_TIME_absolute_is_past (meta->expire_deposit.abs_time)) + { + /* should have been filtered by DB query already! */ + GNUNET_break (0); + return; + } if (GNUNET_OK != TALER_exchange_offline_denom_validity_verify ( h_denom_pub, @@ -3132,7 +3138,8 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh) else if (has_age_restricted_denomination && ! TEH_age_restriction_enabled) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Age restriction is NOT enabled, but denominations with age restriction found!\n"); + "Age restriction is NOT enabled, but denominations with age restriction found!\n") + ; goto CLEANUP; } } diff --git a/src/exchangedb/pg_iterate_denominations.c b/src/exchangedb/pg_iterate_denominations.c @@ -134,7 +134,10 @@ TEH_PG_iterate_denominations (void *cls, void *cb_cls) { struct PostgresClosure *pg = cls; + struct GNUNET_TIME_Absolute now + = GNUNET_TIME_absolute_get (); struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_absolute_time (&now), GNUNET_PQ_query_param_end }; struct DenomsIteratorContext dic = { @@ -163,7 +166,8 @@ TEH_PG_iterate_denominations (void *cls, ",denom_pub" " FROM denominations" " LEFT JOIN " - " denomination_revocations USING (denominations_serial);"); + " denomination_revocations USING (denominations_serial)" + " WHERE expire_deposit > $1;"); return GNUNET_PQ_eval_prepared_multi_select (pg->conn, "select_denominations", params,