From 332a37292c1db7261ebc6bb6fbb9ceacd7cc3220 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 6 Oct 2017 21:54:55 +0200 Subject: handle (most) TEH_KS_acquire errors --- src/exchange/taler-exchange-httpd_refresh_reveal.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/exchange/taler-exchange-httpd_refresh_reveal.c') 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;irefresh_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;jrefresh_session.num_newcoins;j++) { qs = refresh_exchange_coin (connection, -- cgit v1.2.3