[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: insert missing roll
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: insert missing rollback, move another rollback to proper location |
Date: |
Sat, 18 Aug 2018 13:33:16 +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 04692ee insert missing rollback, move another rollback to proper
location
04692ee is described below
commit 04692ee482cc0951adff62f7a4d309135d2c59cc
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Aug 18 13:33:13 2018 +0200
insert missing rollback, move another rollback to proper location
---
src/backend/taler-merchant-httpd_pay.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_pay.c
b/src/backend/taler-merchant-httpd_pay.c
index f1444be..60c6a0a 100644
--- a/src/backend/taler-merchant-httpd_pay.c
+++ b/src/backend/taler-merchant-httpd_pay.c
@@ -1461,7 +1461,7 @@ parse_pay (struct MHD_Connection *connection,
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Frontend specified wire transfer delay\n");
-
+
struct GNUNET_JSON_Specification wspec[] = {
GNUNET_JSON_spec_relative_time ("wire_transfer_delay",
&used_wire_transfer_delay),
@@ -1687,6 +1687,17 @@ begin_transaction (struct PayContext *pc)
GNUNET_assert (GNUNET_YES == pc->suspended);
+ /* Init. some price accumulators. */
+ GNUNET_break (GNUNET_OK ==
+ TALER_amount_get_zero (pc->amount.currency,
+ &pc->total_paid));
+ GNUNET_break (GNUNET_OK ==
+ TALER_amount_get_zero (pc->amount.currency,
+ &pc->total_fees_paid));
+ GNUNET_break (GNUNET_OK ==
+ TALER_amount_get_zero (pc->amount.currency,
+ &pc->total_refunded));
+
/* First, try to see if we have all we need already done */
db->preflight (db->cls);
if (GNUNET_OK !=
@@ -1701,17 +1712,6 @@ begin_transaction (struct PayContext *pc)
return;
}
- /* Init. some price accumulators. */
- GNUNET_break (GNUNET_OK ==
- TALER_amount_get_zero (pc->amount.currency,
- &pc->total_paid));
- GNUNET_break (GNUNET_OK ==
- TALER_amount_get_zero (pc->amount.currency,
- &pc->total_fees_paid));
- GNUNET_break (GNUNET_OK ==
- TALER_amount_get_zero (pc->amount.currency,
- &pc->total_refunded));
-
/* Check if some of these coins already succeeded for _this_ contract. */
qs = db->find_payments (db->cls,
&pc->h_contract_terms,
@@ -1828,9 +1828,9 @@ begin_transaction (struct PayContext *pc)
qs = db->commit (db->cls);
if (0 > qs)
{
+ db->rollback (db->cls);
if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
{
- db->rollback (db->cls);
begin_transaction (pc);
return;
}
@@ -1926,6 +1926,8 @@ begin_transaction (struct PayContext *pc)
pc->session_id);
if (0 <= qs)
qs = db->commit (db->cls);
+ else
+ db->rollback (db->cls);
if (0 > qs)
{
if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: insert missing rollback, move another rollback to proper location,
gnunet <=