From 7ff58c3d8f2351c57142b4b65ab75304f355fc4f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 5 Mar 2022 14:36:49 +0100 Subject: refactor /wire to include logic to return the wad fee (for W2W payments) --- src/exchangedb/lrbt_callbacks.c | 58 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) (limited to 'src/exchangedb/lrbt_callbacks.c') diff --git a/src/exchangedb/lrbt_callbacks.c b/src/exchangedb/lrbt_callbacks.c index 7f1d2fdb..233ecbc1 100644 --- a/src/exchangedb/lrbt_callbacks.c +++ b/src/exchangedb/lrbt_callbacks.c @@ -1173,9 +1173,11 @@ lrbt_cb_table_wire_fee (void *cls, GNUNET_PQ_result_spec_timestamp ("end_date", &td.details.wire_fee.end_date), TALER_PQ_RESULT_SPEC_AMOUNT ("wire_fee", - &td.details.wire_fee.wire_fee), + &td.details.wire_fee.fees.wire), TALER_PQ_RESULT_SPEC_AMOUNT ("closing_fee", - &td.details.wire_fee.closing_fee), + &td.details.wire_fee.fees.closing), + TALER_PQ_RESULT_SPEC_AMOUNT ("wad_fee", + &td.details.wire_fee.fees.wad), GNUNET_PQ_result_spec_auto_from_type ("master_sig", &td.details.wire_fee.master_sig), GNUNET_PQ_result_spec_end @@ -1197,6 +1199,58 @@ lrbt_cb_table_wire_fee (void *cls, } +/** + * Function called with wire_fee table entries. + * + * @param cls closure + * @param result the postgres result + * @param num_results the number of results in @a result + */ +static void +lrbt_cb_table_global_fee (void *cls, + PGresult *result, + unsigned int num_results) +{ + struct LookupRecordsByTableContext *ctx = cls; + struct PostgresClosure *pg = ctx->pg; + struct TALER_EXCHANGEDB_TableData td = { + .table = TALER_EXCHANGEDB_RT_GLOBAL_FEE + }; + + for (unsigned int i = 0; ierror = true; + return; + } + ctx->cb (ctx->cb_cls, + &td); + GNUNET_PQ_cleanup_result (rs); + } +} + + /** * Function called with recoup table entries. * -- cgit v1.2.3