[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: make use of impleme
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: make use of implementation of #5254 |
Date: |
Thu, 18 Jan 2018 17:00:59 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new fa3662a make use of implementation of #5254
fa3662a is described below
commit fa3662acca77d39717516a74e9c710ef1c496be8
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Jan 18 17:00:49 2018 +0100
make use of implementation of #5254
---
src/backend/taler-merchant-httpd_tip-authorize.c | 28 ++++++++++++++----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_tip-authorize.c
b/src/backend/taler-merchant-httpd_tip-authorize.c
index 89f198d..bf155e0 100644
--- a/src/backend/taler-merchant-httpd_tip-authorize.c
+++ b/src/backend/taler-merchant-httpd_tip-authorize.c
@@ -48,11 +48,6 @@ struct TipAuthContext
struct MHD_Connection *connection;
/**
- * Tip amount requested.
- */
- struct TALER_Amount amount;
-
- /**
* Merchant instance to use.
*/
const char *instance;
@@ -88,6 +83,17 @@ struct TipAuthContext
struct TMH_EXCHANGES_FindOperation *fo;
/**
+ * Reserve expiration time as provided by the exchange.
+ * Set in #exchange_cont.
+ */
+ struct GNUNET_TIME_Relative idle_reserve_expiration_time;
+
+ /**
+ * Tip amount requested.
+ */
+ struct TALER_Amount amount;
+
+ /**
* Private key used by this merchant for the tipping reserve.
*/
struct TALER_ReservePrivateKeyP reserve_priv;
@@ -159,7 +165,6 @@ handle_status (void *cls,
const struct TALER_EXCHANGE_ReserveHistory *history)
{
struct TipAuthContext *tac = cls;
- struct GNUNET_TIME_Relative idle_reserve_expiration_time;
tac->rsh = NULL;
if (MHD_HTTP_OK != http_status)
@@ -173,10 +178,6 @@ handle_status (void *cls,
return;
}
- /* TODO: get this from the exchange! (See #5254.) */
- idle_reserve_expiration_time = GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_WEEKS,
- 4);
-
/* Update DB based on status! */
for (unsigned int i=0;i<history_length;i++)
{
@@ -189,7 +190,7 @@ handle_status (void *cls,
struct GNUNET_TIME_Absolute expiration;
expiration = GNUNET_TIME_absolute_add
(history[i].details.in_details.timestamp,
- idle_reserve_expiration_time);
+
tac->idle_reserve_expiration_time);
GNUNET_CRYPTO_hash (history[i].details.in_details.wire_reference,
history[i].details.in_details.wire_reference_size,
&uuid);
@@ -243,6 +244,7 @@ exchange_cont (void *cls,
{
struct TipAuthContext *tac = cls;
struct TALER_ReservePublicKeyP reserve_pub;
+ const struct TALER_EXCHANGE_Keys *keys;
tac->fo = NULL;
if (NULL == eh)
@@ -253,6 +255,10 @@ exchange_cont (void *cls,
TMH_trigger_daemon ();
return;
}
+ keys = TALER_EXCHANGE_get_keys (eh);
+ GNUNET_assert (NULL != keys);
+ tac->idle_reserve_expiration_time
+ = keys->reserve_closing_delay;
GNUNET_CRYPTO_eddsa_key_get_public (&tac->reserve_priv.eddsa_priv,
&reserve_pub.eddsa_pub);
tac->rsh = TALER_EXCHANGE_reserve_status (eh,
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: make use of implementation of #5254,
gnunet <=