From 6e90ef9f4a8ab5352a948fd7fd4de9150a778ce5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 10 Apr 2016 02:43:09 +0200 Subject: implement selection by wire_deadline as documented --- src/exchangedb/plugin_exchangedb_postgres.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index de8a3f247..092aebc48 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -950,10 +950,11 @@ postgres_prepare (PGconn *db_conn) " FROM deposits" " WHERE" " tiny=false AND" - " done=false" + " done=false AND" + " wire_deadline<$1" " ORDER BY wire_deadline ASC" " LIMIT 1", - 0, NULL); + 1, NULL); /* Used in #postgres_iterate_matching_deposits() */ PREPARE ("deposits_iterate_matching", @@ -2231,7 +2232,9 @@ postgres_get_ready_deposit (void *cls, TALER_EXCHANGEDB_DepositIterator deposit_cb, void *deposit_cb_cls) { + struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_absolute_time (&now), GNUNET_PQ_query_param_end }; PGresult *result; -- cgit v1.2.3