summaryrefslogtreecommitdiff
path: root/src/auditor
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/auditor
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/auditor')
-rw-r--r--src/auditor/taler-auditor.c24
-rw-r--r--src/auditor/taler-wire-auditor.c19
2 files changed, 8 insertions, 35 deletions
diff --git a/src/auditor/taler-auditor.c b/src/auditor/taler-auditor.c
index 6752b34ab..d2bd8de6d 100644
--- a/src/auditor/taler-auditor.c
+++ b/src/auditor/taler-auditor.c
@@ -5258,28 +5258,14 @@ run (void *cls,
return;
}
{
- 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 (currency,
- &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))
+ TALER_config_get_amount (cfg,
+ "taler",
+ "CURRENCY_ROUND_UNIT",
+ &currency_round_unit))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Invalid amount `%s' specified in `TALER' under `CURRENCY_ROUND_UNIT'\n",
- rounding_str);
- GNUNET_free (rounding_str);
+ "Invalid or missing amount in `TALER' under `CURRENCY_ROUND_UNIT'\n");
global_ret = 1;
return;
}
diff --git a/src/auditor/taler-wire-auditor.c b/src/auditor/taler-wire-auditor.c
index 73f1f9db9..6821aedb2 100644
--- a/src/auditor/taler-wire-auditor.c
+++ b/src/auditor/taler-wire-auditor.c
@@ -2103,7 +2103,6 @@ run (void *cls,
const struct GNUNET_CONFIGURATION_Handle *c)
{
static const struct TALER_MasterPublicKeyP zeromp;
- char *tinys;
(void) cls;
(void) args;
@@ -2113,22 +2112,11 @@ run (void *cls,
start_time = GNUNET_TIME_absolute_get ();
cfg = c;
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "auditor",
- "TINY_AMOUNT",
- &tinys))
- {
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ TALER_config_get_amount (cfg,
"auditor",
- "TINY_AMOUNT");
- global_ret = 1;
- return;
- }
- if (GNUNET_OK !=
- TALER_string_to_amount (tinys,
- &tiny_amount))
+ "TINY_AMOUNT",
+ &tiny_amount))
{
- GNUNET_free (tinys);
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
"auditor",
"TINY_AMOUNT",
@@ -2136,7 +2124,6 @@ run (void *cls,
global_ret = 1;
return;
}
- GNUNET_free (tinys);
if (0 == GNUNET_memcmp (&zeromp,
&master_pub))
{