refuse to start if we have no denominations

This commit is contained in:
Florian Dold 2016-11-25 16:25:33 +01:00
parent f6fe309f5d
commit f5d7653ef0
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -673,9 +673,14 @@ TEH_KS_acquire_ (const char *location)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Loading keys from `%s'\n",
TEH_exchange_directory);
TALER_EXCHANGEDB_denomination_keys_iterate (TEH_exchange_directory,
if (-1 == TALER_EXCHANGEDB_denomination_keys_iterate (TEH_exchange_directory,
&reload_keys_denom_iter,
key_state);
key_state))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Can't load denomination keys.\n");
GNUNET_assert (0 == pthread_mutex_unlock (&internal_key_state_mutex));
return NULL;
}
TALER_EXCHANGEDB_signing_keys_iterate (TEH_exchange_directory,
&reload_keys_sign_iter,
key_state);
@ -693,6 +698,14 @@ TEH_KS_acquire_ (const char *location)
return NULL;
}
if (0 == GNUNET_CONTAINER_multihashmap_size (key_state->denomkey_map))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Have no denomination keys. Bad configuration.\n");
GNUNET_assert (0 == pthread_mutex_unlock (&internal_key_state_mutex));
return NULL;
}
ks.purpose.size = htonl (sizeof (ks));
ks.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_KEY_SET);
ks.list_issue_date = GNUNET_TIME_absolute_hton (key_state->reload_time);