summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_refund.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-10-06 21:54:55 +0200
committerChristian Grothoff <christian@grothoff.org>2017-10-06 21:54:55 +0200
commit332a37292c1db7261ebc6bb6fbb9ceacd7cc3220 (patch)
tree8a815d39417f13bc5a4bed09f4b2e85d9ca9d5ee /src/exchange/taler-exchange-httpd_refund.c
parent98b7444a7b122498e5b6d693c4503b1702763307 (diff)
downloadexchange-332a37292c1db7261ebc6bb6fbb9ceacd7cc3220.tar.gz
exchange-332a37292c1db7261ebc6bb6fbb9ceacd7cc3220.tar.bz2
exchange-332a37292c1db7261ebc6bb6fbb9ceacd7cc3220.zip
handle (most) TEH_KS_acquire errors
Diffstat (limited to 'src/exchange/taler-exchange-httpd_refund.c')
-rw-r--r--src/exchange/taler-exchange-httpd_refund.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/exchange/taler-exchange-httpd_refund.c b/src/exchange/taler-exchange-httpd_refund.c
index 9846c73b..46c6dfd4 100644
--- a/src/exchange/taler-exchange-httpd_refund.c
+++ b/src/exchange/taler-exchange-httpd_refund.c
@@ -241,7 +241,7 @@ refund_transaction (void *cls,
tl);
*mhd_ret = TEH_RESPONSE_reply_transaction_unknown (connection,
TALER_EC_REFUND_DEPOSIT_NOT_FOUND);
- return GNUNET_DB_STATUS_HARD_ERROR;
+ return GNUNET_DB_STATUS_HARD_ERROR;
}
/* handle if conflicting refund found */
if (GNUNET_SYSERR == refund_found)
@@ -250,7 +250,7 @@ refund_transaction (void *cls,
tl);
TEH_plugin->free_coin_transaction_list (TEH_plugin->cls,
tl);
- return GNUNET_DB_STATUS_HARD_ERROR;
+ return GNUNET_DB_STATUS_HARD_ERROR;
}
/* handle if identical refund found */
if (GNUNET_YES == refund_found)
@@ -297,7 +297,7 @@ refund_transaction (void *cls,
}
if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
return qs; /* go and retry */
-
+
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs)
{
/* money was already transferred to merchant, can no longer refund */
@@ -325,6 +325,16 @@ refund_transaction (void *cls,
// FIXME: do this outside of transaction function?
/* Check refund fee matches fee of denomination key! */
mks = TEH_KS_acquire ();
+ if (NULL == mks)
+ {
+ TALER_LOG_ERROR ("Lacking keys to operate\n");
+ TEH_plugin->free_coin_transaction_list (TEH_plugin->cls,
+ tl);
+ *mhd_ret = TEH_RESPONSE_reply_internal_error (connection,
+ TALER_EC_EXCHANGE_BAD_CONFIGURATION,
+ "no keys");
+ return GNUNET_DB_STATUS_HARD_ERROR;
+ }
dki = TEH_KS_denomination_key_lookup (mks,
&dep->coin.denom_pub,
TEH_KS_DKU_DEPOSIT);