diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-10 02:43:09 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-10 02:43:09 +0200 |
commit | 6e90ef9f4a8ab5352a948fd7fd4de9150a778ce5 (patch) | |
tree | 5cac6568c4a8a216e76eed853841d24b421974b1 | |
parent | bf92166be3af89313f2e59ca64ecb716c0ca760d (diff) |
implement selection by wire_deadline as documented
-rw-r--r-- | src/exchangedb/plugin_exchangedb_postgres.c | 7 |
1 files 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; |