summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_handle.c
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-01-17 16:37:16 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2019-01-17 16:37:16 +0100
commit148b546435a8fdd83372d4f546d809f5322ae05b (patch)
tree5fe02ad38cbb2f5e7ffe1e3f7671e99ba593a620 /src/lib/exchange_api_handle.c
parentaeec67acaa786f9bf42e61df2d8c6d93198e8609 (diff)
downloadexchange-148b546435a8fdd83372d4f546d809f5322ae05b.tar.gz
exchange-148b546435a8fdd83372d4f546d809f5322ae05b.tar.bz2
exchange-148b546435a8fdd83372d4f546d809f5322ae05b.zip
/keys API.
Adding method to override the last_denom value for a key set.
Diffstat (limited to 'src/lib/exchange_api_handle.c')
-rw-r--r--src/lib/exchange_api_handle.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index bace2b47b..284dbbb34 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -1030,6 +1030,21 @@ request_keys (void *cls);
void
TEAH_handle_reset (struct TALER_EXCHANGE_Handle *h);
+
+
+/**
+ * Let the user set the last valid denomination time manually.
+ *
+ * @param exchange the exchange handle.
+ * @param last_denom_new new last denomination time.
+ */
+void
+TALER_EXCHANGE_set_last_denom (struct TALER_EXCHANGE_Handle *exchange,
+ struct GNUNET_TIME_Absolute last_denom_new)
+{
+ exchange->key_data.last_denom_issue_date = last_denom_new;
+}
+
/**
* Check if our current response for /keys is valid, and if
* not trigger download.
@@ -1047,8 +1062,12 @@ TALER_EXCHANGE_check_keys_current (struct TALER_EXCHANGE_Handle *exchange,
{
if (NULL != exchange->kr)
return GNUNET_TIME_UNIT_ZERO_ABS;
+
if (GNUNET_YES == pull_all_keys)
+ {
+ GNUNET_assert (GNUNET_YES == force_download);
TEAH_handle_reset (exchange);
+ }
if ( (GNUNET_NO == force_download) &&
(0 < GNUNET_TIME_absolute_get_remaining (exchange->key_data_expiration).rel_value_us) )
return exchange->key_data_expiration;