summaryrefslogtreecommitdiff
path: root/src/auditor/taler-auditor.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-04-20 21:38:02 +0200
committerChristian Grothoff <christian@grothoff.org>2017-04-20 21:38:02 +0200
commit27c921c7c45f8ea8fed5c945a9e0ae0cfcc1c8e9 (patch)
tree16da56b06fb589d3be77fc48c2116b7cb54647dc /src/auditor/taler-auditor.c
parent92d9ec69e6d8e9f7eb0be0d6a7f67444189b319e (diff)
downloadexchange-27c921c7c45f8ea8fed5c945a9e0ae0cfcc1c8e9.tar.gz
exchange-27c921c7c45f8ea8fed5c945a9e0ae0cfcc1c8e9.tar.bz2
exchange-27c921c7c45f8ea8fed5c945a9e0ae0cfcc1c8e9.zip
finished implementing #4956 in principle, but not yet tested
Diffstat (limited to 'src/auditor/taler-auditor.c')
-rw-r--r--src/auditor/taler-auditor.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/auditor/taler-auditor.c b/src/auditor/taler-auditor.c
index 5db848982..fa8940f58 100644
--- a/src/auditor/taler-auditor.c
+++ b/src/auditor/taler-auditor.c
@@ -100,6 +100,11 @@ static struct TALER_AUDITORDB_Plugin *adb;
static struct TALER_AUDITORDB_Session *asession;
/**
+ * After how long should idle reserves be closed?
+ */
+static struct GNUNET_TIME_Relative idle_reserve_expiration_time;
+
+/**
* Master public key of the exchange to audit.
*/
static struct TALER_MasterPublicKeyP master_pub;
@@ -672,7 +677,7 @@ handle_reserve_in (void *cls,
TALER_B2S (reserve_pub),
TALER_amount2s (credit));
expiry = GNUNET_TIME_absolute_add (execution_date,
- TALER_IDLE_RESERVE_EXPIRATION_TIME);
+ idle_reserve_expiration_time);
rs->a_expiration_date = GNUNET_TIME_absolute_max (rs->a_expiration_date,
expiry);
return GNUNET_OK;
@@ -973,7 +978,7 @@ handle_payback_by_reserve (void *cls,
TALER_B2S (reserve_pub),
TALER_amount2s (amount));
expiry = GNUNET_TIME_absolute_add (timestamp,
- TALER_IDLE_RESERVE_EXPIRATION_TIME);
+ idle_reserve_expiration_time);
rs->a_expiration_date = GNUNET_TIME_absolute_max (rs->a_expiration_date,
expiry);
return GNUNET_OK;
@@ -1002,7 +1007,7 @@ handle_reserve_closed (void *cls,
const struct TALER_Amount *closing_fee,
const struct TALER_ReservePublicKeyP *reserve_pub,
const json_t *receiver_account,
- const json_t *transfer_details)
+ const struct TALER_WireTransferIdentifierRawP *transfer_details)
{
struct ReserveContext *rc = cls;
struct GNUNET_HashCode key;
@@ -3613,6 +3618,18 @@ run (void *cls,
global_ret = 1;
return;
}
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_time (cfg,
+ "exchangedb",
+ "IDLE_RESERVE_EXPIRATION_TIME",
+ &idle_reserve_expiration_time))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "exchangedb",
+ "IDLE_RESERVE_EXPIRATION_TIME");
+ global_ret = 1;
+ return;
+ }
if (NULL ==
(edb = TALER_EXCHANGEDB_plugin_load (cfg)))
{