summaryrefslogtreecommitdiff
path: root/src/exchange-tools
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-04-17 14:01:55 +0200
committerChristian Grothoff <christian@grothoff.org>2017-04-17 14:01:55 +0200
commit164c125528e4af078815c0156df54fa0120eed8a (patch)
tree9d0a82d7a678059850f260b1f5fda79db3f57c32 /src/exchange-tools
parent5a321621f40d09b4f38bdd6dd43ee6580915fba2 (diff)
downloadexchange-164c125528e4af078815c0156df54fa0120eed8a.tar.gz
exchange-164c125528e4af078815c0156df54fa0120eed8a.tar.bz2
exchange-164c125528e4af078815c0156df54fa0120eed8a.zip
introducing closing fee
Diffstat (limited to 'src/exchange-tools')
-rw-r--r--src/exchange-tools/taler-exchange-keyup.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/exchange-tools/taler-exchange-keyup.c b/src/exchange-tools/taler-exchange-keyup.c
index f5e5961f0..ce6f2ba2a 100644
--- a/src/exchange-tools/taler-exchange-keyup.c
+++ b/src/exchange-tools/taler-exchange-keyup.c
@@ -949,6 +949,8 @@ create_wire_fee_for_method (void *cls,
af = GNUNET_new (struct TALER_EXCHANGEDB_AggregateFees);
af->start_date = start_date;
af->end_date = end_date;
+
+ /* handle wire fee */
GNUNET_asprintf (&opt,
"wire-fee-%u",
year);
@@ -980,6 +982,40 @@ create_wire_fee_for_method (void *cls,
break;
}
GNUNET_free (amounts);
+
+ /* handle closing fee */
+ GNUNET_asprintf (&opt,
+ "closing-fee-%u",
+ year);
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (kcfg,
+ section,
+ opt,
+ &amounts))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ section,
+ opt);
+ *ret = GNUNET_SYSERR;
+ GNUNET_free (opt);
+ break;
+ }
+ if (GNUNET_OK !=
+ TALER_string_to_amount (amounts,
+ &af->closing_fee))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Invalid amount `%s' specified in `%s' under `%s'\n",
+ amounts,
+ wiremethod,
+ opt);
+ *ret = GNUNET_SYSERR;
+ GNUNET_free (amounts);
+ GNUNET_free (opt);
+ break;
+ }
+ GNUNET_free (amounts);
+
GNUNET_free (opt);
sign_af (af,
wiremethod,