aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_batch2_reserves_in_insert.c
diff options
context:
space:
mode:
authorJoseph <Joseph.xu@efrei.net>2022-12-21 05:29:06 -0500
committerJoseph <Joseph.xu@efrei.net>2022-12-21 05:29:47 -0500
commitb90d25ecfcaad0bd421998360dff2c4629b5705b (patch)
tree528760c99d6f3d15f26876151aa0d01787206ec7 /src/exchangedb/pg_batch2_reserves_in_insert.c
parent802dbaefc984807c54000bd9f695254690dbdcd5 (diff)
downloadexchange-b90d25ecfcaad0bd421998360dff2c4629b5705b.tar.xz
Rollback in sqlcode
Diffstat (limited to 'src/exchangedb/pg_batch2_reserves_in_insert.c')
-rw-r--r--src/exchangedb/pg_batch2_reserves_in_insert.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/exchangedb/pg_batch2_reserves_in_insert.c b/src/exchangedb/pg_batch2_reserves_in_insert.c
index f80f7ea07..268f20d46 100644
--- a/src/exchangedb/pg_batch2_reserves_in_insert.c
+++ b/src/exchangedb/pg_batch2_reserves_in_insert.c
@@ -820,21 +820,22 @@ TEH_PG_batch2_reserves_in_insert (void *cls,
enum GNUNET_DB_QueryStatus qs3;
PREPARE (pg,
- "reserves_in_add_transaction",
+ "reserves_update",
"CALL exchange_do_batch_reserves_update"
" ($1,$2,$3,$4,$5,$6,$7,$8,$9);");
for (unsigned int i = 0; i<reserves_length; i++)
{
+
if (! conflicts[i])
continue;
{
- const struct TALER_EXCHANGEDB_ReserveInInfo *reserve = &reserves[i];
+ // const struct TALER_EXCHANGEDB_ReserveInInfo *reserve = &reserves[i];
struct GNUNET_PQ_QueryParam params[] = {
- GNUNET_PQ_query_param_auto_from_type (reserve->reserve_pub),
+ GNUNET_PQ_query_param_auto_from_type (reserves[i].reserve_pub),
GNUNET_PQ_query_param_timestamp (&expiry),
- GNUNET_PQ_query_param_uint64 (&reserve->wire_reference),
- TALER_PQ_query_param_amount (reserve->balance),
- GNUNET_PQ_query_param_string (reserve->exchange_account_name),
+ GNUNET_PQ_query_param_uint64 (&reserves[i].wire_reference),
+ TALER_PQ_query_param_amount (reserves[i].balance),
+ GNUNET_PQ_query_param_string (reserves[i].exchange_account_name),
GNUNET_PQ_query_param_bool (conflicts[i]),
GNUNET_PQ_query_param_auto_from_type (&h_payto),
GNUNET_PQ_query_param_string (notify_s[i]),
@@ -842,12 +843,12 @@ TEH_PG_batch2_reserves_in_insert (void *cls,
};
qs3 = GNUNET_PQ_eval_prepared_non_select (pg->conn,
- "reserves_in_add_transaction",
+ "reserves_update",
params);
if (qs3<0)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Failed to update reserves (%d)\n",
+ "Failed to update (%d)\n",
qs3);
return qs3;
}