[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-exchange] branch master updated: add -r command line
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-exchange] branch master updated: add -r command line option to wirewatch |
Date: |
Sun, 10 Dec 2017 19:15:17 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new 0b9ffa8 add -r command line option to wirewatch
0b9ffa8 is described below
commit 0b9ffa874f7dcf9e39061ec3dc066ea128a90aee
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Dec 10 19:15:15 2017 +0100
add -r command line option to wirewatch
---
doc/taler-exchange-wirewatch.1 | 3 ++
src/exchange/taler-exchange-wirewatch.c | 50 ++++++++++++++++++++-------------
2 files changed, 34 insertions(+), 19 deletions(-)
diff --git a/doc/taler-exchange-wirewatch.1 b/doc/taler-exchange-wirewatch.1
index 41a4afa..9b030ab 100644
--- a/doc/taler-exchange-wirewatch.1
+++ b/doc/taler-exchange-wirewatch.1
@@ -22,6 +22,9 @@ Print short help on options.
.IP "\-T, \-\-test"
Run in test mode and exit when idle.
.B
+.IP "\-r, \-\-reset"
+Ignore our own database and start with transactions from the beginning of time.
+.B
.IP "\-v, \-\-version"
Print version information.
.B
diff --git a/src/exchange/taler-exchange-wirewatch.c
b/src/exchange/taler-exchange-wirewatch.c
index 7fbc0b8..e878594 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -117,6 +117,11 @@ static int delay;
static int test_mode;
/**
+ * Are we running from scratch and should re-process all transactions?
+ */
+static int reset_mode;
+
+/**
* Next task to run, if any.
*/
static struct GNUNET_SCHEDULER_Task *task;
@@ -443,26 +448,29 @@ find_transfers (void *cls)
GNUNET_SCHEDULER_shutdown ();
return;
}
- qs = db_plugin->get_latest_reserve_in_reference (db_plugin->cls,
- session,
- &start_off,
- &start_off_size);
- if (GNUNET_DB_STATUS_HARD_ERROR == qs)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Failed to obtain starting point for montoring from
database!\n");
- global_ret = GNUNET_SYSERR;
- GNUNET_SCHEDULER_shutdown ();
- return;
- }
- if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
+ if (! reset_mode)
{
- /* try again */
- db_plugin->rollback (db_plugin->cls,
- session);
- task = GNUNET_SCHEDULER_add_now (&find_transfers,
- NULL);
- return;
+ qs = db_plugin->get_latest_reserve_in_reference (db_plugin->cls,
+ session,
+ &start_off,
+ &start_off_size);
+ if (GNUNET_DB_STATUS_HARD_ERROR == qs)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to obtain starting point for montoring from
database!\n");
+ global_ret = GNUNET_SYSERR;
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
+ {
+ /* try again */
+ db_plugin->rollback (db_plugin->cls,
+ session);
+ task = GNUNET_SCHEDULER_add_now (&find_transfers,
+ NULL);
+ return;
+ }
}
delay = GNUNET_YES;
hh = wire_plugin->get_history (wire_plugin->cls,
@@ -535,6 +543,10 @@ main (int argc,
"test",
"run in test mode and exit when idle",
&test_mode),
+ GNUNET_GETOPT_option_flag ('r',
+ "reset",
+ "start fresh with all transactions in the
history",
+ &reset_mode),
GNUNET_GETOPT_OPTION_END
};
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-exchange] branch master updated: add -r command line option to wirewatch,
gnunet <=