summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_refresh_reveal.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_refresh_reveal.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_refresh_reveal.c')
-rw-r--r--src/exchange/taler-exchange-httpd_refresh_reveal.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/exchange/taler-exchange-httpd_refresh_reveal.c b/src/exchange/taler-exchange-httpd_refresh_reveal.c
index cfb2b68ac..5d857fcae 100644
--- a/src/exchange/taler-exchange-httpd_refresh_reveal.c
+++ b/src/exchange/taler-exchange-httpd_refresh_reveal.c
@@ -531,7 +531,7 @@ refresh_reveal_transaction (void *cls,
for (unsigned int i=0;i<TALER_CNC_KAPPA;i++)
{
int res;
-
+
if (i == rc->refresh_session.noreveal_index)
{
off = 1;
@@ -542,7 +542,7 @@ refresh_reveal_transaction (void *cls,
rc->refresh_session.num_newcoins,
rc->commit_coins);
if (0 >= qs)
- {
+ {
cleanup_rc (rc);
GNUNET_CRYPTO_hash_context_abort (hash_context);
if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
@@ -596,7 +596,7 @@ refresh_reveal_transaction (void *cls,
cleanup_rc (rc);
return GNUNET_DB_STATUS_HARD_ERROR;
}
-
+
/* Client request OK, sign coins */
rc->ev_sigs = GNUNET_new_array (rc->refresh_session.num_newcoins,
struct TALER_DenominationSignature);
@@ -604,6 +604,12 @@ refresh_reveal_transaction (void *cls,
struct TEH_KS_StateHandle *key_state;
key_state = TEH_KS_acquire ();
+ if (NULL == key_state)
+ {
+ TALER_LOG_ERROR ("Lacking keys to operate\n");
+ cleanup_rc (rc);
+ return GNUNET_DB_STATUS_HARD_ERROR;
+ }
for (unsigned int j=0;j<rc->refresh_session.num_newcoins;j++)
{
qs = refresh_exchange_coin (connection,