aboutsummaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_keys.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-07-15 19:29:13 +0200
committerChristian Grothoff <christian@grothoff.org>2023-07-15 19:29:13 +0200
commitcd45ba408a791c7a95ad2d28eca222522d326268 (patch)
treee9310e5502db810f9675b25228d3931207b99197 /src/exchange/taler-exchange-httpd_keys.c
parentea47fb40c050d1aa10ee501996d9b9377d3ca742 (diff)
-fix up config
Diffstat (limited to 'src/exchange/taler-exchange-httpd_keys.c')
-rw-r--r--src/exchange/taler-exchange-httpd_keys.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c
index cc93a420..9623a5a3 100644
--- a/src/exchange/taler-exchange-httpd_keys.c
+++ b/src/exchange/taler-exchange-httpd_keys.c
@@ -849,6 +849,9 @@ build_wire_state (void)
wire_method = TALER_payto_get_method (payto_uri);
if (NULL == wire_method)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "No wire method in `%s'\n",
+ payto_uri);
wsh->http_status = MHD_HTTP_INTERNAL_SERVER_ERROR;
wsh->wire_reply
= TALER_MHD_make_error (
@@ -888,25 +891,20 @@ build_wire_state (void)
GNUNET_CRYPTO_hash_context_abort (hc);
return wsh;
}
- if (0 == json_array_size (ac.a))
+ if (0 != json_array_size (ac.a))
+ {
+ wsh->cache_expiration
+ = GNUNET_TIME_absolute_min (ac.max_seen,
+ wsh->cache_expiration);
+ GNUNET_assert (0 ==
+ json_object_set_new (wire_fee_object,
+ wire_method,
+ ac.a));
+ }
+ else
{
json_decref (ac.a);
- json_decref (wire_accounts_array);
- json_decref (wire_fee_object);
- wsh->http_status = MHD_HTTP_INTERNAL_SERVER_ERROR;
- wsh->wire_reply
- = TALER_MHD_make_error (TALER_EC_EXCHANGE_WIRE_FEES_NOT_CONFIGURED,
- wire_method);
- GNUNET_free (wire_method);
- GNUNET_CRYPTO_hash_context_abort (hc);
- return wsh;
}
- wsh->cache_expiration = GNUNET_TIME_absolute_min (ac.max_seen,
- wsh->cache_expiration);
- GNUNET_assert (0 ==
- json_object_set_new (wire_fee_object,
- wire_method,
- ac.a));
}
GNUNET_free (wire_method);
}
@@ -2438,6 +2436,11 @@ create_krd (struct TEH_KeyStateHandle *ksh,
json_t *keys;
wsh = get_wire_state ();
+ if (MHD_HTTP_OK != wsh->http_status)
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
GNUNET_assert (! GNUNET_TIME_absolute_is_zero (
last_cherry_pick_date.abs_time));
GNUNET_assert (NULL != signkeys);