summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-aggregator.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-01-19 20:57:32 +0100
committerChristian Grothoff <christian@grothoff.org>2020-01-19 20:57:32 +0100
commit4fac247bc7187cd611daad87563396c06a8295e4 (patch)
tree25965fa06ace4886f07c997a2b9ea47f10101d1b /src/exchange/taler-exchange-aggregator.c
parent6f3c6827221fae6da47a113af4172e8f269bd38c (diff)
downloadexchange-4fac247bc7187cd611daad87563396c06a8295e4.tar.gz
exchange-4fac247bc7187cd611daad87563396c06a8295e4.tar.bz2
exchange-4fac247bc7187cd611daad87563396c06a8295e4.zip
use TALER_config_get_amount() consistently, require currency rounding option to exist instead of defaulting
Diffstat (limited to 'src/exchange/taler-exchange-aggregator.c')
-rw-r--r--src/exchange/taler-exchange-aggregator.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c
index e9474d89..0718fdda 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -603,28 +603,16 @@ exchange_serve_process_config ()
}
{
- char *rounding_str;
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "taler",
- "CURRENCY_ROUND_UNIT",
- &rounding_str))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "No [taler]/CURRENCY_ROUND_UNIT specified, defaulting to '0.01'.\n");
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_get_zero (exchange_currency_string,
- &currency_round_unit));
- currency_round_unit.fraction = TALER_AMOUNT_FRAC_BASE / 100;
- }
- else if (GNUNET_OK !=
- TALER_string_to_amount (rounding_str,
- &currency_round_unit))
+ if ( (GNUNET_OK !=
+ TALER_config_get_amount (cfg,
+ "taler",
+ "CURRENCY_ROUND_UNIT",
+ &currency_round_unit)) ||
+ ( (0 != currency_round_unit.fraction) &&
+ (0 != currency_round_unit.value) ) )
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Invalid amount `%s' specified in `TALER' under `CURRENCY_ROUND_UNIT'\n",
- rounding_str);
- GNUNET_free (rounding_str);
+ "Invalid value specified in `TALER' under `CURRENCY_ROUND_UNIT'\n");
return GNUNET_SYSERR;
}
}