summaryrefslogtreecommitdiff
path: root/src/exchangedb/plugin_exchangedb_postgres.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-08-16 14:36:23 +0200
committerChristian Grothoff <christian@grothoff.org>2022-08-16 14:36:23 +0200
commit68d2df88f2ec0b70c3778f7f77eeb6173bd8c08b (patch)
treeba7b155be05788a698fef6685b4fffcf9c10075a /src/exchangedb/plugin_exchangedb_postgres.c
parent94fa05ec2a96ca7bdc47f3dc77aa727ae81f9a44 (diff)
downloadexchange-68d2df88f2ec0b70c3778f7f77eeb6173bd8c08b.tar.gz
exchange-68d2df88f2ec0b70c3778f7f77eeb6173bd8c08b.tar.bz2
exchange-68d2df88f2ec0b70c3778f7f77eeb6173bd8c08b.zip
allow merge into non-existent reserve if KYC is disabled
Diffstat (limited to 'src/exchangedb/plugin_exchangedb_postgres.c')
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index 39c1be4bf..e593b0df9 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -4450,10 +4450,9 @@ prepare_statements (struct PostgresClosure *pg)
"SELECT"
" out_no_partner AS no_partner"
",out_no_balance AS no_balance"
- ",out_no_reserve AS no_reserve"
",out_conflict AS conflict"
" FROM exchange_do_purse_merge"
- " ($1, $2, $3, $4, $5, $6, $7);",
+ " ($1, $2, $3, $4, $5, $6, $7, $8);",
7),
/* Used in #postgres_do_reserve_purse() */
GNUNET_PQ_make_prepare (
@@ -16007,7 +16006,6 @@ postgres_get_purse_deposit (
* @param reserve_pub public key of the reserve to credit
* @param[out] no_partner set to true if @a partner_url is unknown
* @param[out] no_balance set to true if the @a purse_pub is not paid up yet
- * @param[out] no_reserve set to true if the @a reserve_pub is not known
* @param[out] in_conflict set to true if @a purse_pub was merged into a different reserve already
* @return transaction status code
*/
@@ -16022,11 +16020,12 @@ postgres_do_purse_merge (
const struct TALER_ReservePublicKeyP *reserve_pub,
bool *no_partner,
bool *no_balance,
- bool *no_reserve,
bool *in_conflict)
{
struct PostgresClosure *pg = cls;
struct TALER_PaytoHashP h_payto;
+ struct GNUNET_TIME_Timestamp expiration
+ = GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_YEARS); /* FIXME: make this configurable? */
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (purse_pub),
GNUNET_PQ_query_param_auto_from_type (merge_sig),
@@ -16037,6 +16036,7 @@ postgres_do_purse_merge (
: GNUNET_PQ_query_param_string (partner_url),
GNUNET_PQ_query_param_auto_from_type (reserve_pub),
GNUNET_PQ_query_param_auto_from_type (&h_payto),
+ GNUNET_PQ_query_param_timestamp (&expiration),
GNUNET_PQ_query_param_end
};
struct GNUNET_PQ_ResultSpec rs[] = {
@@ -16044,8 +16044,6 @@ postgres_do_purse_merge (
no_partner),
GNUNET_PQ_result_spec_bool ("no_balance",
no_balance),
- GNUNET_PQ_result_spec_bool ("no_reserve",
- no_reserve),
GNUNET_PQ_result_spec_bool ("conflict",
in_conflict),
GNUNET_PQ_result_spec_end