diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-06-11 11:57:05 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-06-11 11:57:05 +0200 |
commit | 1eb739c670ffdb3363f54b1efdcb8343cb1bd272 (patch) | |
tree | e874f5cb19a34b8a245e6f49799ea16dbcb128c6 /src/exchange/taler-exchange-wirewatch.c | |
parent | 0ef7116ecf6b772ecbcc489e2b96078d338fe9c7 (diff) | |
download | exchange-1eb739c670ffdb3363f54b1efdcb8343cb1bd272.tar.gz exchange-1eb739c670ffdb3363f54b1efdcb8343cb1bd272.tar.bz2 exchange-1eb739c670ffdb3363f54b1efdcb8343cb1bd272.zip |
add --test option to taler-exchange-wirewatch
Diffstat (limited to 'src/exchange/taler-exchange-wirewatch.c')
-rw-r--r-- | src/exchange/taler-exchange-wirewatch.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c index a3009219b..0a7923a11 100644 --- a/src/exchange/taler-exchange-wirewatch.c +++ b/src/exchange/taler-exchange-wirewatch.c @@ -95,6 +95,11 @@ static char *type; static int delay; /** + * Are we run in testing mode and should only do one pass? + */ +static int test_mode; + +/** * Next task to run, if any. */ static struct GNUNET_SCHEDULER_Task *task; @@ -234,6 +239,12 @@ history_cb (void *cls, start_off = last_row_off; start_off_size = last_row_off_size; } + if ( (GNUNET_YES == delay) && + (test_mode) ) + { + GNUNET_SCHEDULER_shutdown (); + return GNUNET_OK; + } if (GNUNET_YES == delay) task = GNUNET_SCHEDULER_add_delayed (DELAY, &find_transfers, @@ -289,6 +300,7 @@ find_transfers (void *cls) struct TALER_EXCHANGEDB_Session *session; int ret; + task = NULL; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Checking for incoming wire transfers\n"); @@ -389,6 +401,10 @@ main (int argc, "PLUGINNAME", "which wire plugin to use", &type), + GNUNET_GETOPT_option_flag ('T', + "test", + "run in test mode and exit when idle", + &test_mode), GNUNET_GETOPT_OPTION_END }; |