summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-07-11 20:36:52 +0200
committerChristian Grothoff <christian@grothoff.org>2023-07-11 20:36:52 +0200
commita5451527cb26d876388567dc26113a83e0b79e15 (patch)
treee034247b14e29f19e9c515561fc0f24d1a833671 /src/exchange
parente984dbd8f48b6f4588d39e4c30ef8bceaad7e55d (diff)
downloadexchange-a5451527cb26d876388567dc26113a83e0b79e15.tar.gz
exchange-a5451527cb26d876388567dc26113a83e0b79e15.tar.bz2
exchange-a5451527cb26d876388567dc26113a83e0b79e15.zip
implement 'lost' field for #7883
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-httpd_keys.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c
index d1d8edc26..2c705829f 100644
--- a/src/exchange/taler-exchange-httpd_keys.c
+++ b/src/exchange/taler-exchange-httpd_keys.c
@@ -2960,8 +2960,18 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
/* Now that we have found/created the right group, add the
denomination to the list */
{
+ struct HelperDenomination *hd;
struct GNUNET_JSON_PackSpec key_spec;
-
+ bool private_key_lost;
+
+ hd = GNUNET_CONTAINER_multihashmap_get (ksh->helpers->denom_keys,
+ &dk->h_denom_pub.hash);
+ private_key_lost
+ = (NULL == hd) ||
+ GNUNET_TIME_absolute_is_past (
+ GNUNET_TIME_absolute_add (
+ hd->start_time.abs_time,
+ hd->validity_duration));
switch (meta.cipher)
{
case TALER_DENOMINATION_RSA:
@@ -2984,6 +2994,12 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
entry = GNUNET_JSON_PACK (
GNUNET_JSON_pack_data_auto ("master_sig",
&dk->master_sig),
+ GNUNET_JSON_pack_allow_null (
+ private_key_lost
+ ? GNUNET_JSON_pack_bool ("lost",
+ true)
+ : GNUNET_JSON_pack_string ("dummy",
+ NULL)),
GNUNET_JSON_pack_timestamp ("stamp_start",
dk->meta.start),
GNUNET_JSON_pack_timestamp ("stamp_expire_withdraw",