summaryrefslogtreecommitdiff
path: root/src/mint/taler-mint-httpd_db.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-07-05 13:05:58 +0200
committerChristian Grothoff <christian@grothoff.org>2015-07-05 13:05:58 +0200
commit9084ac48216876c8a2f9d5a1a78c4b6216676de7 (patch)
treedcbad31fca661cdb29e0950ea6ad783421a6f86c /src/mint/taler-mint-httpd_db.c
parentff6d4c081c4485d007439c1f9132e6718b099e2a (diff)
downloadexchange-9084ac48216876c8a2f9d5a1a78c4b6216676de7.tar.gz
exchange-9084ac48216876c8a2f9d5a1a78c4b6216676de7.tar.bz2
exchange-9084ac48216876c8a2f9d5a1a78c4b6216676de7.zip
fixing RC counting and a comma
Diffstat (limited to 'src/mint/taler-mint-httpd_db.c')
-rw-r--r--src/mint/taler-mint-httpd_db.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/mint/taler-mint-httpd_db.c b/src/mint/taler-mint-httpd_db.c
index e4e8c59ec..5afc104f5 100644
--- a/src/mint/taler-mint-httpd_db.c
+++ b/src/mint/taler-mint-httpd_db.c
@@ -411,11 +411,23 @@ TMH_DB_execute_withdraw_sign (struct MHD_Connection *connection,
break;
}
}
+ if (0 == (res & 1))
+ {
+ /* did not encounter any deposit operations, how can we have a reserve? */
+ GNUNET_break (0);
+ return TMH_RESPONSE_reply_internal_db_error (connection);
+ }
+ if (0 == (res & 2))
+ {
+ /* did not encounter any withdraw operations, set to zero */
+ TALER_amount_get_zero (deposit_total.currency,
+ &withdraw_total);
+ }
/* All reserve balances should be non-negative */
- GNUNET_break (GNUNET_SYSERR !=
- TALER_amount_subtract (&balance,
- &deposit_total,
- &withdraw_total));
+ GNUNET_assert (GNUNET_SYSERR !=
+ TALER_amount_subtract (&balance,
+ &deposit_total,
+ &withdraw_total));
if (0 < TALER_amount_cmp (&amount_required,
&balance))
{