summaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_lookup_wire_transfer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/pg_lookup_wire_transfer.c')
-rw-r--r--src/exchangedb/pg_lookup_wire_transfer.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/exchangedb/pg_lookup_wire_transfer.c b/src/exchangedb/pg_lookup_wire_transfer.c
index c5f63a070..7ab023fe7 100644
--- a/src/exchangedb/pg_lookup_wire_transfer.c
+++ b/src/exchangedb/pg_lookup_wire_transfer.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2022 Taler Systems SA
+ Copyright (C) 2022-2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -48,14 +48,14 @@ struct WireTransferResultContext
/**
* Set to #GNUNET_SYSERR on serious errors.
*/
- int status;
+ enum GNUNET_GenericReturnValue status;
};
/**
* Function to be called with the results of a SELECT statement
* that has returned @a num_results results. Helper function
- * for #postgres_lookup_wire_transfer().
+ * for #TEH_PG_lookup_wire_transfer().
*
* @param cls closure of type `struct WireTransferResultContext *`
* @param result the postgres result
@@ -82,7 +82,8 @@ handle_wt_result (void *cls,
struct TALER_DenominationPublicKey denom_pub;
char *payto_uri;
struct GNUNET_PQ_ResultSpec rs[] = {
- GNUNET_PQ_result_spec_uint64 ("aggregation_serial_id", &rowid),
+ GNUNET_PQ_result_spec_uint64 ("aggregation_serial_id",
+ &rowid),
GNUNET_PQ_result_spec_auto_from_type ("h_contract_terms",
&h_contract_terms),
GNUNET_PQ_result_spec_string ("payto_uri",
@@ -141,33 +142,32 @@ TEH_PG_lookup_wire_transfer (
GNUNET_PQ_query_param_auto_from_type (wtid),
GNUNET_PQ_query_param_end
};
- struct WireTransferResultContext ctx;
+ struct WireTransferResultContext ctx = {
+ .cb = cb,
+ .cb_cls = cb_cls,
+ .pg = pg,
+ .status = GNUNET_OK
+ };
enum GNUNET_DB_QueryStatus qs;
- ctx.cb = cb;
- ctx.cb_cls = cb_cls;
- ctx.pg = pg;
- ctx.status = GNUNET_OK;
- /* check if the melt record exists and get it */
- /* Used in #postgres_lookup_wire_transfer */
PREPARE (pg,
"lookup_transactions",
"SELECT"
" aggregation_serial_id"
- ",deposits.h_contract_terms"
+ ",bdep.h_contract_terms"
",payto_uri"
",wire_targets.wire_target_h_payto"
",kc.coin_pub"
- ",deposits.merchant_pub"
+ ",bdep.merchant_pub"
",wire_out.execution_date"
- ",deposits.amount_with_fee_val"
- ",deposits.amount_with_fee_frac"
- ",denom.fee_deposit_val"
- ",denom.fee_deposit_frac"
+ ",cdep.amount_with_fee"
+ ",denom.fee_deposit"
",denom.denom_pub"
" FROM aggregation_tracking"
- " JOIN deposits"
- " USING (deposit_serial_id)"
+ " JOIN batch_deposits bdep"
+ " USING (batch_deposit_serial_id)"
+ " JOIN coin_deposits cdep"
+ " USING (batch_deposit_serial_id)"
" JOIN wire_targets"
" USING (wire_target_h_payto)"
" JOIN known_coins kc"