aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-02-28 23:00:13 +0100
committerChristian Grothoff <christian@grothoff.org>2024-02-28 23:00:13 +0100
commit3f0bfbeb22578f6d2ee699100fd185132fbf1c88 (patch)
treeb2da9d9fab9b395091f2524d392be1118aea03bc /src
parentf16b094ed6d5e851e3cb75c68158ad08a5a1fe5e (diff)
downloadexchange-3f0bfbeb22578f6d2ee699100fd185132fbf1c88.tar.xz
implement #8449
Diffstat (limited to 'src')
-rw-r--r--src/exchange/taler-exchange-httpd.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
index 21f2d080b..bc8e76ab3 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -165,12 +165,6 @@ struct TALER_Amount TEH_stefan_log;
float TEH_stefan_lin;
/**
- * Default number of fractional digits to render
- * amounts with.
- */
-unsigned int TEH_currency_fraction_digits;
-
-/**
* Our currency.
*/
char *TEH_currency;
@@ -2060,6 +2054,11 @@ handle_mhd_request (void *cls,
static enum GNUNET_GenericReturnValue
exchange_serve_process_config (void)
{
+ static struct TALER_CurrencySpecification defspec = {
+ .num_fractional_input_digits = 2,
+ .num_fractional_normal_digits = 2,
+ .num_fractional_trailing_zero_digits = 2
+ };
if (GNUNET_OK !=
TALER_KYCLOGIC_kyc_init (TEH_cfg))
{
@@ -2140,11 +2139,21 @@ exchange_serve_process_config (void)
}
if (NULL == TEH_cspec)
{
- GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
+ GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_WARNING,
"taler",
"CURRENCY",
- "Lacking enabled currency specification for the given currency");
- return GNUNET_SYSERR;
+ "Lacking enabled currency specification for the given currency, using default");
+ defspec.map_alt_unit_names
+ = GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_string ("0",
+ TEH_currency)
+ );
+ defspec.name = TEH_currency;
+ GNUNET_assert (strlen (TEH_currency) <
+ sizeof (defspec.currency));
+ strcpy (defspec.currency,
+ TEH_currency);
+ TEH_cspec = &defspec;
}
if (GNUNET_OK !=
TALER_config_get_amount (TEH_cfg,