summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-11-30 17:17:37 +0100
committerChristian Grothoff <christian@grothoff.org>2017-11-30 17:17:37 +0100
commit5540747ca2e5f37f2df504d689b850d1078fcdc5 (patch)
tree0e8be904bdedfe74a7cf78e1c27f7edc614c6301 /src/exchange
parent78b77ee8d515c80ac85ca7af59e3e82c2baaeb68 (diff)
downloadexchange-5540747ca2e5f37f2df504d689b850d1078fcdc5.tar.gz
exchange-5540747ca2e5f37f2df504d689b850d1078fcdc5.tar.bz2
exchange-5540747ca2e5f37f2df504d689b850d1078fcdc5.zip
patch to address #5183: always round time before giving it to DB, tolerate DB answering without rounded time
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-aggregator.c5
-rw-r--r--src/exchange/test_taler_exchange_aggregator.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c
index 84aef1a89..788e817fd 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -1102,6 +1102,7 @@ run_reserve_closures (void *cls)
enum GNUNET_DB_QueryStatus qs;
const struct GNUNET_SCHEDULER_TaskContext *tc;
struct ExpiredReserveContext erc;
+ struct GNUNET_TIME_Absolute now;
task = NULL;
reserves_idle = GNUNET_NO;
@@ -1130,9 +1131,11 @@ run_reserve_closures (void *cls)
}
erc.session = session;
erc.async_cont = GNUNET_NO;
+ now = GNUNET_TIME_absolute_get ();
+ (void) GNUNET_TIME_round_abs (&now);
qs = db_plugin->get_expired_reserves (db_plugin->cls,
session,
- GNUNET_TIME_absolute_get (),
+ now,
&expired_reserve_cb,
&erc);
switch (qs)
diff --git a/src/exchange/test_taler_exchange_aggregator.c b/src/exchange/test_taler_exchange_aggregator.c
index 0b56b4854..178b5aa32 100644
--- a/src/exchange/test_taler_exchange_aggregator.c
+++ b/src/exchange/test_taler_exchange_aggregator.c
@@ -440,7 +440,9 @@ do_deposit (struct Command *cmd)
TALER_JSON_hash (deposit.receiver_wire_account,
&deposit.h_wire));
deposit.timestamp = GNUNET_TIME_absolute_get ();
+ GNUNET_TIME_round_abs (&deposit.timestamp);
deposit.wire_deadline = GNUNET_TIME_relative_to_absolute (cmd->details.deposit.wire_deadline);
+ GNUNET_TIME_round_abs (&deposit.wire_deadline);
/* finally, actually perform the DB operation */
if ( (GNUNET_OK !=