aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_select_refunds_by_coin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/pg_select_refunds_by_coin.c')
-rw-r--r--src/exchangedb/pg_select_refunds_by_coin.c42
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 17885a47..6510ae4a 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,