gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-exchange] branch master updated: implement #5254


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: implement #5254
Date: Thu, 18 Jan 2018 16:55:19 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 5c3d25e  implement #5254
5c3d25e is described below

commit 5c3d25eb29ec9b36dfd09eb65abcad5fd2421142
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Jan 18 16:55:16 2018 +0100

    implement #5254
---
 src/exchange-lib/exchange_api_handle.c       |  2 ++
 src/exchange/taler-exchange-httpd_keystate.c | 21 +++++++++++++++++++--
 src/include/taler_exchange_service.h         |  7 +++++++
 3 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/exchange-lib/exchange_api_handle.c 
b/src/exchange-lib/exchange_api_handle.c
index 22e64b9..2810a60 100644
--- a/src/exchange-lib/exchange_api_handle.c
+++ b/src/exchange-lib/exchange_api_handle.c
@@ -575,6 +575,8 @@ decode_keys_json (const json_t *resp_obj,
                                    &pub),
       GNUNET_JSON_spec_absolute_time ("list_issue_date",
                                       &list_issue_date),
+      GNUNET_JSON_spec_relative_time ("reserve_closing_delay",
+                                      &key_data->reserve_closing_delay),
       GNUNET_JSON_spec_end()
     };
 
diff --git a/src/exchange/taler-exchange-httpd_keystate.c 
b/src/exchange/taler-exchange-httpd_keystate.c
index 801d6fe..f57451a 100644
--- a/src/exchange/taler-exchange-httpd_keystate.c
+++ b/src/exchange/taler-exchange-httpd_keystate.c
@@ -1183,6 +1183,7 @@ build_keys_response (const struct ResponseFactoryContext 
*rfc,
   struct TALER_ExchangeKeySetPS ks;
   struct TALER_ExchangeSignatureP sig;
   char *keys_json;
+  struct GNUNET_TIME_Relative reserve_closing_delay;
   void *keys_jsonz;
   size_t keys_jsonz_size;
   int comp;
@@ -1287,13 +1288,29 @@ build_keys_response (const struct 
ResponseFactoryContext *rfc,
                  GNUNET_CRYPTO_eddsa_sign 
(&rfc->key_state->current_sign_key_issue.signkey_priv.eddsa_priv,
                                            &ks.purpose,
                                            &sig.eddsa_signature));
-
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_time (cfg,
+                                           "exchangedb",
+                                           "IDLE_RESERVE_EXPIRATION_TIME",
+                                           &reserve_closing_delay))
+  {
+    GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+                               "exchangedb",
+                               "IDLE_RESERVE_EXPIRATION_TIME");
+    /* use default */
+    reserve_closing_delay = GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_WEEKS,
+                                                           4);
+  }
   /* Build /keys response */
-  keys = json_pack ("{s:s, s:o, s:O, s:O, s:o, s:o, s:o, s:o, s:o}",
+  keys = json_pack ("{s:s, s:o, s:o, s:O, s:O,"
+                    " s:o, s:o, s:o, s:o, s:o}",
+                    /* 1-5 */
                     "version", TALER_PROTOCOL_VERSION,
                     "master_public_key", GNUNET_JSON_from_data_auto 
(&TEH_master_public_key),
+                    "reserve_closing_delay", GNUNET_JSON_from_time_rel 
(reserve_closing_delay),
                     "signkeys", rfc->sign_keys_array,
                     "payback", rfc->payback_array,
+                    /* 6-10 */
                     "denoms", rbc.denom_keys_array,
                     "auditors", rbc.auditors_array,
                     "list_issue_date", GNUNET_JSON_from_time_abs 
(rfc->key_state->reload_time),
diff --git a/src/include/taler_exchange_service.h 
b/src/include/taler_exchange_service.h
index 2d9460e..30ea4ce 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -206,6 +206,13 @@ struct TALER_EXCHANGE_Keys
   char *version;
 
   /**
+   * How long after a reserve went idle will the exchange close it?
+   * This is an approximate number, not cryptographically signed by
+   * the exchange (advisory-only, may change anytime).
+   */
+  struct GNUNET_TIME_Relative reserve_closing_delay;
+
+  /**
    * Timestamp indicating the /keys generation.
    */
   struct GNUNET_TIME_Absolute list_issue_date;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]