summaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-07-30 17:20:20 +0200
committerChristian Grothoff <christian@grothoff.org>2023-07-30 17:20:20 +0200
commitdc81d01304e3cf93c4ae86ab8c11fa778aff583f (patch)
tree151daa398ae8fb01b5989eca843349da444acb83 /src/exchangedb
parentc8e485088b0139c56edd45ab20ae6d7cfc196dbc (diff)
downloadexchange-dc81d01304e3cf93c4ae86ab8c11fa778aff583f.tar.gz
exchange-dc81d01304e3cf93c4ae86ab8c11fa778aff583f.tar.bz2
exchange-dc81d01304e3cf93c4ae86ab8c11fa778aff583f.zip
add missing prepared statements
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/pg_add_policy_fulfillment_proof.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/exchangedb/pg_add_policy_fulfillment_proof.c b/src/exchangedb/pg_add_policy_fulfillment_proof.c
index 2e83b5742..0fd6b1c92 100644
--- a/src/exchangedb/pg_add_policy_fulfillment_proof.c
+++ b/src/exchangedb/pg_add_policy_fulfillment_proof.c
@@ -94,7 +94,15 @@ TEH_PG_add_policy_fulfillment_proof (
GNUNET_PQ_result_spec_end
};
- // FIXME: where do we prepare this statement!??
+ PREPARE (pg,
+ "insert_proof_into_policy_fulfillments",
+ "INSERT INTO policy_fulfillments"
+ "(fulfillment_timestamp"
+ ",fulfillment_proof"
+ ",h_fulfillment_proof"
+ ",policy_hash_codes"
+ ") VALUES ($1, $2, $3, $4)"
+ " ON CONFLICT DO NOTHING;");
qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
"insert_proof_into_policy_fulfillments",
params,
@@ -124,7 +132,17 @@ TEH_PG_add_policy_fulfillment_proof (
GNUNET_PQ_query_param_end
};
- // FIXME: where do we prepare this statement!??
+ // FIXME-Oec: review if this is the intended logic here!
+ PREPARE (pg,
+ "update_policy_details",
+ "UPDATE policy_details SET"
+ " deadline=$2"
+ ",commitment=$3"
+ ",accumulated_total=$4"
+ ",fee=$5"
+ ",transferable=$6"
+ ",fulfillment_state=$7"
+ " WHERE policy_hash_code=$1;");
qs = GNUNET_PQ_eval_prepared_non_select (pg->conn,
"update_policy_details",
params);