aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_handle.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-06-07 23:11:05 +0200
committerChristian Grothoff <christian@grothoff.org>2023-06-07 23:11:05 +0200
commita2dde02b64a8ee75c9243632eb45a6ceb9b62dd5 (patch)
tree378cb6aefaf7f00894a7c8916fad9c3de84e31b4 /src/lib/exchange_api_handle.c
parent015b08b0489d72f3fda587eec900bc4193a6a57e (diff)
downloadexchange-a2dde02b64a8ee75c9243632eb45a6ceb9b62dd5.tar.xz
major libtalertesting API refactoring, including no longer having taler-specific logic in the test engine core
Diffstat (limited to 'src/lib/exchange_api_handle.c')
-rw-r--r--src/lib/exchange_api_handle.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index d78b6185b..20bac43a0 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -1268,14 +1268,24 @@ TALER_EXCHANGE_set_last_denom (struct TALER_EXCHANGE_Handle *exchange,
struct GNUNET_TIME_Timestamp
TALER_EXCHANGE_check_keys_current (struct TALER_EXCHANGE_Handle *exchange,
- enum TALER_EXCHANGE_CheckKeysFlags flags)
+ enum TALER_EXCHANGE_CheckKeysFlags flags,
+ TALER_EXCHANGE_CertificationCallback cb,
+ void *cb_cls)
{
bool force_download = 0 != (flags & TALER_EXCHANGE_CKF_FORCE_DOWNLOAD);
bool pull_all_keys = 0 != (flags & TALER_EXCHANGE_CKF_PULL_ALL_KEYS);
+ if ( (NULL != cb) &&
+ ( (exchange->cert_cb != cb) ||
+ (exchange->cert_cb_cls != cb_cls) ) )
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Changing target of exchange certification callback\n");
+ exchange->cert_cb = cb;
+ exchange->cert_cb_cls = cb_cls;
+ }
if (NULL != exchange->kr)
return GNUNET_TIME_UNIT_ZERO_TS;
-
if (pull_all_keys)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -2269,7 +2279,9 @@ const struct TALER_EXCHANGE_Keys *
TALER_EXCHANGE_get_keys (struct TALER_EXCHANGE_Handle *exchange)
{
(void) TALER_EXCHANGE_check_keys_current (exchange,
- TALER_EXCHANGE_CKF_NONE);
+ TALER_EXCHANGE_CKF_NONE,
+ NULL,
+ NULL);
return &exchange->key_data;
}
@@ -2278,7 +2290,9 @@ json_t *
TALER_EXCHANGE_get_keys_raw (struct TALER_EXCHANGE_Handle *exchange)
{
(void) TALER_EXCHANGE_check_keys_current (exchange,
- TALER_EXCHANGE_CKF_NONE);
+ TALER_EXCHANGE_CKF_NONE,
+ NULL,
+ NULL);
return json_deep_copy (exchange->key_data_raw);
}