aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-07-05 11:54:14 +0200
committerChristian Grothoff <christian@grothoff.org>2015-07-05 11:54:14 +0200
commitff6d4c081c4485d007439c1f9132e6718b099e2a (patch)
treee476f160902dae60a4e510af024adbaf2b5e5383 /src
parent24df12db9bd2b3464e709acf9c8dbfd05bb181f9 (diff)
neat error reporting
Diffstat (limited to 'src')
-rw-r--r--src/mint-lib/test_mint_api.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/mint-lib/test_mint_api.c b/src/mint-lib/test_mint_api.c
index dbacb3ef9..6d8e0638d 100644
--- a/src/mint-lib/test_mint_api.c
+++ b/src/mint-lib/test_mint_api.c
@@ -385,6 +385,9 @@ withdraw_sign_cb (void *cls,
struct InterpreterState *is = cls;
struct Command *cmd = &is->commands[is->ip];
+ fprintf (stderr,
+ "Withdraw completed: %u\n",
+ http_status);
cmd->details.withdraw_sign.wsh = NULL;
if (NULL == sig)
{
@@ -424,17 +427,26 @@ find_pk (const struct TALER_MINT_Keys *keys,
(now.abs_value_us >= pk->valid_from.abs_value_us) &&
(now.abs_value_us < pk->withdraw_valid_until.abs_value_us) )
return pk;
+ }
+ /* do 2nd pass to check if expiration times are to blame for failure */
+ str = TALER_amount_to_string (amount);
+ for (i=0;i<keys->num_denom_keys;i++)
+ {
if ( (0 == TALER_amount_cmp (amount,
&pk->value)) &&
( (now.abs_value_us < pk->valid_from.abs_value_us) ||
(now.abs_value_us > pk->withdraw_valid_until.abs_value_us) ) )
+ {
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Have a matching denomination key, but with wrong expiration range %llu vs [%llu,%llu)\n",
+ "Have denomination key for `%s', but with wrong expiration range %llu vs [%llu,%llu)\n",
+ str,
now.abs_value_us,
pk->valid_from.abs_value_us,
pk->withdraw_valid_until.abs_value_us);
+ GNUNET_free (str);
+ return NULL;
+ }
}
- str = TALER_amount_to_string (amount);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"No denomination key for amount %s found\n",
str);