summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-08-29 01:39:01 +0200
committerChristian Grothoff <christian@grothoff.org>2020-08-29 01:39:01 +0200
commit43d1009f4f333b9413866624eee3861d96da8a5c (patch)
treee19c0cc2204edce11bf5c0dd4c4523b46ae1b64d /src
parent9eeda0dce4374e22aad4f1cf58a8661001dd3954 (diff)
downloadmerchant-43d1009f4f333b9413866624eee3861d96da8a5c.tar.gz
merchant-43d1009f4f333b9413866624eee3861d96da8a5c.tar.bz2
merchant-43d1009f4f333b9413866624eee3861d96da8a5c.zip
fix commit logic
Diffstat (limited to 'src')
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-pay.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
index 4626e3d2..915f3056 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
@@ -1409,12 +1409,11 @@ begin_transaction (struct PayContext *pc)
}
/* Now commit! */
- if (0 <= qs)
- qs = TMH_db->commit (TMH_db->cls);
- else
- TMH_db->rollback (TMH_db->cls);
+ qs = TMH_db->commit (TMH_db->cls);
if (0 > qs)
{
+ /* commit failed */
+ TMH_db->rollback (TMH_db->cls);
if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
{
begin_transaction (pc);