From b53c189e0a0d53df325cb9abeaaa515fa3414c18 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 8 May 2017 14:35:48 +0200 Subject: [PATCH] nominally finish implementation of taler-exchange-wirewatch (still needs testing) --- src/exchange/taler-exchange-wirewatch.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c index 6daf5caca..195aa47d9 100644 --- a/src/exchange/taler-exchange-wirewatch.c +++ b/src/exchange/taler-exchange-wirewatch.c @@ -219,8 +219,6 @@ history_cb (void *cls, { hh = NULL; - /* FIXME: commit last_off to DB!? - (or just select via 'reserves_in' by SERIAL ID!?) */ ret = db_plugin->commit (db_plugin->cls, session); if (GNUNET_OK == ret) @@ -278,6 +276,7 @@ static void find_transfers (void *cls) { struct TALER_EXCHANGEDB_Session *session; + int ret; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Checking for incoming wire transfers\n"); @@ -300,8 +299,18 @@ find_transfers (void *cls) GNUNET_SCHEDULER_shutdown (); return; } - /* FIXME: fetch start_off from DB! */ - + ret = db_plugin->get_latest_reserve_in_reference (db_plugin->cls, + session, + &start_off, + &start_off_size); + if (GNUNET_SYSERR == ret) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to obtain starting point for montoring from database!\n"); + global_ret = GNUNET_SYSERR; + GNUNET_SCHEDULER_shutdown (); + return; + } delay = GNUNET_YES; hh = wire_plugin->get_history (wire_plugin->cls, TALER_BANK_DIRECTION_CREDIT,