diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-11-23 13:40:07 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-11-23 13:40:07 +0100 |
commit | 505ea0a0431d54dd8be76cb6ca6c7846db04d76f (patch) | |
tree | 0bc6c9abdca5db9098a6ffcad01903cc8434754f /src/exchangedb/pg_select_refunds_by_coin.c | |
parent | 9d43bf92c45e771afdada11851393e0a82a91078 (diff) | |
download | exchange-505ea0a0431d54dd8be76cb6ca6c7846db04d76f.tar.xz |
-starting point for Joseph
Diffstat (limited to 'src/exchangedb/pg_select_refunds_by_coin.c')
-rw-r--r-- | src/exchangedb/pg_select_refunds_by_coin.c | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/src/exchangedb/pg_select_refunds_by_coin.c b/src/exchangedb/pg_select_refunds_by_coin.c index 17885a474..6510ae4a2 100644 --- a/src/exchangedb/pg_select_refunds_by_coin.c +++ b/src/exchangedb/pg_select_refunds_by_coin.c @@ -119,19 +119,35 @@ TEH_PG_select_refunds_by_coin ( .status = GNUNET_OK }; - /* Query the 'refunds' by coin public key */ - /* Query the 'refunds' by coin public key, merchant_pub and contract hash */ - PREPARE (pg, - "get_refunds_by_coin_and_contract", - "SELECT" - " ref.amount_with_fee_val" - ",ref.amount_with_fee_frac" - " FROM refunds ref" - " JOIN deposits dep" - " USING (coin_pub,deposit_serial_id)" - " WHERE ref.coin_pub=$1" - " AND dep.merchant_pub=$2" - " AND dep.h_contract_terms=$3;"); + if (NULL == getenv ("NEW_LOGIC")) + { + PREPARE (pg, + "get_refunds_by_coin_and_contract", + "SELECT" + " ref.amount_with_fee_val" + ",ref.amount_with_fee_frac" + " FROM refunds ref" + " JOIN deposits dep" + " USING (coin_pub,deposit_serial_id)" + " WHERE ref.coin_pub=$1" + " AND dep.merchant_pub=$2" + " AND dep.h_contract_terms=$3;"); + } + else + { + // FIXME-Joseph + PREPARE (pg, + "get_refunds_by_coin_and_contract", + "SELECT" + " ref.amount_with_fee_val" + ",ref.amount_with_fee_frac" + " FROM refunds ref" + " JOIN deposits dep" + " USING (coin_pub,deposit_serial_id)" + " WHERE ref.coin_pub=$1" + " AND dep.merchant_pub=$2" + " AND dep.h_contract_terms=$3;"); + } qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, "get_refunds_by_coin_and_contract", params, |