summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_payback.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-11-01 15:36:14 +0100
committerChristian Grothoff <christian@grothoff.org>2019-11-01 15:36:14 +0100
commit375a47d5023c9eccf45d8142a0568824eb4ed7ab (patch)
treedab8a343adfd77a8ddcc6a579cecbe918cba095a /src/exchange/taler-exchange-httpd_payback.c
parent40d9674856dd77a98053f0451d76791de146551f (diff)
downloadexchange-375a47d5023c9eccf45d8142a0568824eb4ed7ab.tar.gz
exchange-375a47d5023c9eccf45d8142a0568824eb4ed7ab.tar.bz2
exchange-375a47d5023c9eccf45d8142a0568824eb4ed7ab.zip
improve status codes returned in case of denomination key troubles
Diffstat (limited to 'src/exchange/taler-exchange-httpd_payback.c')
-rw-r--r--src/exchange/taler-exchange-httpd_payback.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/exchange/taler-exchange-httpd_payback.c b/src/exchange/taler-exchange-httpd_payback.c
index 8a881ffff..05a2355a3 100644
--- a/src/exchange/taler-exchange-httpd_payback.c
+++ b/src/exchange/taler-exchange-httpd_payback.c
@@ -429,6 +429,8 @@ verify_and_execute_payback (struct MHD_Connection *connection,
struct GNUNET_HashCode c_hash;
char *coin_ev;
size_t coin_ev_size;
+ enum TALER_ErrorCode ec;
+ unsigned int hc;
/* check denomination exists and is in payback mode */
key_state = TEH_KS_acquire (GNUNET_TIME_absolute_get ());
@@ -441,15 +443,17 @@ verify_and_execute_payback (struct MHD_Connection *connection,
}
dki = TEH_KS_denomination_key_lookup_by_hash (key_state,
&coin->denom_pub_hash,
- TEH_KS_DKU_PAYBACK);
+ TEH_KS_DKU_PAYBACK,
+ &ec,
+ &hc);
if (NULL == dki)
{
TEH_KS_release (key_state);
TALER_LOG_WARNING (
"Denomination key in /payback request not in payback mode\n");
- return TEH_RESPONSE_reply_arg_unknown (connection,
- TALER_EC_PAYBACK_DENOMINATION_KEY_UNKNOWN,
- "denom_pub");
+ return TEH_RESPONSE_reply_with_error (connection,
+ ec,
+ hc);
}
TALER_amount_ntoh (&pc.value,
&dki->issue.properties.value);