summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-05-27 15:51:41 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2019-05-27 15:51:41 +0200
commit3e295bc2facf85bdf7f1c4f2a1cbe984df510909 (patch)
tree89e3c1c77bc787951395b427f3b11a7a730138a5
parent3f6d32fb3cbad1981f96df6b92bb4de568c5fbe8 (diff)
downloadmerchant-3e295bc2facf85bdf7f1c4f2a1cbe984df510909.tar.gz
merchant-3e295bc2facf85bdf7f1c4f2a1cbe984df510909.tar.bz2
merchant-3e295bc2facf85bdf7f1c4f2a1cbe984df510909.zip
5732.
Not en error, just the log level was set wrong.
-rw-r--r--src/backend/taler-merchant-httpd_refund.c3
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c11
2 files changed, 9 insertions, 5 deletions
diff --git a/src/backend/taler-merchant-httpd_refund.c b/src/backend/taler-merchant-httpd_refund.c
index 0b59ebbe..1a2a0f81 100644
--- a/src/backend/taler-merchant-httpd_refund.c
+++ b/src/backend/taler-merchant-httpd_refund.c
@@ -238,9 +238,10 @@ MH_handler_refund_increase (struct TMH_RequestHandler *rh,
&mi->pubkey,
&refund,
reason);
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"increase refund returned %d\n",
qs);
+
if (GNUNET_DB_STATUS_HARD_ERROR == qs)
{
GNUNET_break (0);
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index db99219b..34689943 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -371,7 +371,6 @@ postgres_initialize (void *cls)
"COMMIT",
0),
- /*NOTE: minimal version, to be expanded on a needed basis*/
GNUNET_PQ_make_prepare ("find_refunds",
"SELECT"
" refund_amount_val"
@@ -2634,7 +2633,9 @@ process_deposits_for_refund_cb (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Total existing refund is %s\n",
TALER_amount2s (&current_refund));
- /* stop immediately if we are done */
+
+ /* stop immediately if we are 'done' === amount already
+ * refunded. */
if (0 >= TALER_amount_cmp (ctx->refund,
&current_refund))
{
@@ -2670,7 +2671,7 @@ process_deposits_for_refund_cb (void *cls,
continue;
}
- /* How much of the refund is left? */
+ /* How much of the refund is still to be paid back? */
if (GNUNET_SYSERR ==
TALER_amount_subtract (&remaining_refund,
ctx->refund,
@@ -2729,6 +2730,7 @@ process_deposits_for_refund_cb (void *cls,
return;
}
}
+
/* stop immediately if we are done */
if (0 == TALER_amount_cmp (ctx->refund,
&current_refund))
@@ -2736,7 +2738,7 @@ process_deposits_for_refund_cb (void *cls,
}
/**
- * We end up here if nto all of the refund has been covered.
+ * We end up here if not all of the refund has been covered.
* Although this should be checked as the business should never
* issue a refund bigger than the contract's actual price, we cannot
* rely upon the frontend being correct.
@@ -2744,6 +2746,7 @@ process_deposits_for_refund_cb (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"The refund of %s is bigger than the order's value\n",
TALER_amount2s (ctx->refund));
+
ctx->qs = GNUNET_DB_STATUS_HARD_ERROR;
}