summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-aggregator.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-16 19:23:29 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-16 19:23:29 +0100
commit6f6c71a8d39e5f1f4d69ec06ad20f832617783d6 (patch)
tree0d6d99bfc2d65d632da771e968bc422754f156ba /src/exchange/taler-exchange-aggregator.c
parente0497239e90df63eaee085a45488e9ff3ee799bc (diff)
downloadexchange-6f6c71a8d39e5f1f4d69ec06ad20f832617783d6.tar.gz
exchange-6f6c71a8d39e5f1f4d69ec06ad20f832617783d6.tar.bz2
exchange-6f6c71a8d39e5f1f4d69ec06ad20f832617783d6.zip
load fees from DB instead of from config, also in wire tools
Diffstat (limited to 'src/exchange/taler-exchange-aggregator.c')
-rw-r--r--src/exchange/taler-exchange-aggregator.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c
index 08892800..af9b1551 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -455,21 +455,29 @@ deposit_cb (void *cls,
au->execution_time = GNUNET_TIME_absolute_get ();
(void) GNUNET_TIME_round_abs (&au->execution_time);
{
- struct TALER_EXCHANGEDB_AggregateFees *af;
-
- af = TALER_EXCHANGEDB_update_fees (cfg,
- db_plugin,
- au->wa,
- au->execution_time,
- au->session);
- if (NULL == af)
+ struct TALER_Amount closing_fee;
+ struct GNUNET_TIME_Absolute start_date;
+ struct GNUNET_TIME_Absolute end_date;
+ struct TALER_MasterSignatureP master_sig;
+ enum GNUNET_DB_QueryStatus qs;
+
+ qs = db_plugin->get_wire_fee (db_plugin->cls,
+ au->session,
+ au->wa->method,
+ au->execution_time,
+ &start_date,
+ &end_date,
+ &au->wire_fee,
+ &closing_fee,
+ &master_sig);
+ if (0 >= qs)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Could not get or persist wire fees for %s. Aborting run.\n",
+ "Could not get wire fees for %s at %s. Aborting run.\n",
+ au->wa->method,
GNUNET_STRINGS_absolute_time_to_string (au->execution_time));
return GNUNET_DB_STATUS_HARD_ERROR;
}
- au->wire_fee = af->wire_fee;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,