diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2023-12-25 02:12:45 +0800 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2023-12-25 02:12:45 +0800 |
commit | fba64a564e04aa4897120c9444e8cb4f8f54ab68 (patch) | |
tree | c715990d204764a882e3b5a231c38a6ffc5b0569 /src/exchangedb | |
parent | 3eebc4b18ae109ea54e5f8788ac29453f74282ac (diff) |
fix #8015 (allow purse merge until they were actually expired/refunded)
Diffstat (limited to 'src/exchangedb')
-rw-r--r-- | src/exchangedb/pg_select_purse_merge.c | 11 | ||||
-rw-r--r-- | src/exchangedb/pg_select_purse_merge.h | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/exchangedb/pg_select_purse_merge.c b/src/exchangedb/pg_select_purse_merge.c index ce9f03618..d58e8892f 100644 --- a/src/exchangedb/pg_select_purse_merge.c +++ b/src/exchangedb/pg_select_purse_merge.c @@ -33,7 +33,8 @@ TEH_PG_select_purse_merge ( struct TALER_PurseMergeSignatureP *merge_sig, struct GNUNET_TIME_Timestamp *merge_timestamp, char **partner_url, - struct TALER_ReservePublicKeyP *reserve_pub) + struct TALER_ReservePublicKeyP *reserve_pub, + bool *refunded) { struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { @@ -52,11 +53,15 @@ TEH_PG_select_purse_merge ( GNUNET_PQ_result_spec_string ("partner_base_url", partner_url), &is_null), + GNUNET_PQ_result_spec_allow_null ( + GNUNET_PQ_result_spec_bool ("refunded", + refunded), + NULL), GNUNET_PQ_result_spec_end }; *partner_url = NULL; - /* Used in #postgres_select_purse_merge */ + *refunded = true; PREPARE (pg, "select_purse_merge", "SELECT " @@ -64,7 +69,9 @@ TEH_PG_select_purse_merge ( ",merge_sig" ",merge_timestamp" ",partner_base_url" + ",refunded" " FROM purse_merges" + " LEFT JOIN purse_decision USING (purse_pub)" " LEFT JOIN partners USING (partner_serial_id)" " WHERE purse_pub=$1;"); return GNUNET_PQ_eval_prepared_singleton_select (pg->conn, diff --git a/src/exchangedb/pg_select_purse_merge.h b/src/exchangedb/pg_select_purse_merge.h index 982225123..8054974aa 100644 --- a/src/exchangedb/pg_select_purse_merge.h +++ b/src/exchangedb/pg_select_purse_merge.h @@ -35,6 +35,7 @@ * @param[out] merge_timestamp set to the time of the merge * @param[out] partner_url set to the URL of the target exchange, or NULL if the target exchange is us. To be freed by the caller. * @param[out] reserve_pub set to the public key of the reserve/account being credited + * @param[out] refunded set to true if purse was refunded * @return transaction status code */ enum GNUNET_DB_QueryStatus @@ -44,6 +45,7 @@ TEH_PG_select_purse_merge ( struct TALER_PurseMergeSignatureP *merge_sig, struct GNUNET_TIME_Timestamp *merge_timestamp, char **partner_url, - struct TALER_ReservePublicKeyP *reserve_pub); + struct TALER_ReservePublicKeyP *reserve_pub, + bool *refunded); #endif |