[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] branch master updated: do not select expired reserves w
From: |
gnunet |
Subject: |
[taler-merchant] branch master updated: do not select expired reserves when auto-selecting reserve for tipping (#6871) |
Date: |
Mon, 17 May 2021 13:54:53 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new fdc385f9 do not select expired reserves when auto-selecting reserve
for tipping (#6871)
fdc385f9 is described below
commit fdc385f93bb4aece0cae5fb0ff560bac7ee68a43
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon May 17 13:54:43 2021 +0200
do not select expired reserves when auto-selecting reserve for tipping
(#6871)
---
configure.ac | 14 ++++++++++++++
src/backenddb/plugin_merchantdb_postgres.c | 9 ++++++---
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 99801c6c..79ccc1f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,20 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
+# This file is part of TALER
+# Copyright (C) 2014-2021 Taler Systems SA
+#
+# TALER is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3, or (at your option) any later version.
+#
+# TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# TALER; see the file COPYING. If not, If not, see
<http://www.gnu.org/license>
+#
# This configure file is in the public domain
AC_PREREQ([2.69])
diff --git a/src/backenddb/plugin_merchantdb_postgres.c
b/src/backenddb/plugin_merchantdb_postgres.c
index e6140087..27d2c059 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -5308,9 +5308,11 @@ RETRY:
}
if (NULL == reserve_pubp)
{
+ struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_string (instance_id),
TALER_PQ_query_param_amount (amount),
+ GNUNET_PQ_query_param_absolute_time (&now),
GNUNET_PQ_query_param_end
};
@@ -8243,12 +8245,13 @@ postgres_connect (void *cls)
" exchange_initial_balance_val -
tips_committed_val > $2"
" OR"
" (exchange_initial_balance_val -
tips_committed_val = $2"
- " AND exchange_initial_balance_frac -
tips_committed_frac >= $3)"
- " AND merchant_serial ="
+ " AND exchange_initial_balance_frac -
tips_committed_frac >= $3)"
+ " AND expiration > $4"
+ " AND merchant_serial ="
" (SELECT merchant_serial"
" FROM merchant_instances"
" WHERE merchant_id=$1)",
- 3),
+ 4),
/* For postgres_authorize_tip() */
GNUNET_PQ_make_prepare ("lookup_reserve_status",
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant] branch master updated: do not select expired reserves when auto-selecting reserve for tipping (#6871),
gnunet <=