[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] 230/277: add amount checks
From: |
gnunet |
Subject: |
[taler-merchant] 230/277: add amount checks |
Date: |
Sun, 05 Jul 2020 20:52:23 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository merchant.
commit 4621e2ea42eed868fa842889a32c7f90b52a863f
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Jun 20 19:49:26 2020 +0200
add amount checks
---
src/backend/taler-merchant-httpd_reserves.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/backend/taler-merchant-httpd_reserves.c
b/src/backend/taler-merchant-httpd_reserves.c
index 1d17632..8231e0d 100644
--- a/src/backend/taler-merchant-httpd_reserves.c
+++ b/src/backend/taler-merchant-httpd_reserves.c
@@ -179,6 +179,27 @@ reserve_cb (void *cls,
try_later (r);
return;
}
+ if (0 !=
+ TALER_amount_cmp_currency (&r->expected_amount,
+ balance))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Reserve currency disagreement: exchange `%s' has %s, expected
%s\n",
+ r->exchange_url,
+ balance->currency,
+ r->expected_amount.currency);
+ free_reserve (r);
+ return;
+ }
+ if (0 !=
+ TALER_amount_cmp (&r->expected_amount,
+ balance))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Reserve initial balance disagreement: exchange `%s' received
`%s'\n",
+ r->exchange_url,
+ TALER_amount2s (balance));
+ }
qs = TMH_db->activate_reserve (TMH_db->cls,
r->instance_id,
&r->reserve_pub,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-merchant] 216/277: clean up logic: use new EXCHANGE_YNA enum, avoid crazy macro construction to build URLs, use full power of TALER_url_join() instead, (continued)
- [taler-merchant] 216/277: clean up logic: use new EXCHANGE_YNA enum, avoid crazy macro construction to build URLs, use full power of TALER_url_join() instead, gnunet, 2020/07/05
- [taler-merchant] 219/277: tests for new db methods, gnunet, 2020/07/05
- [taler-merchant] 204/277: moved yna to exchange, gnunet, 2020/07/05
- [taler-merchant] 214/277: add logic to parse refund details, gnunet, 2020/07/05
- [taler-merchant] 212/277: adjust GET /orders/ID to match spec, gnunet, 2020/07/05
- [taler-merchant] 217/277: implement merchant_api_merchant_get_order.c, gnunet, 2020/07/05
- [taler-merchant] 221/277: test for GET /private/reserves/, gnunet, 2020/07/05
- [taler-merchant] 224/277: stricter tests for tips/reserves, gnunet, 2020/07/05
- [taler-merchant] 223/277: implementations, tests, and renames for GET /tips/ & GET /private/tips/, gnunet, 2020/07/05
- [taler-merchant] 226/277: naive tests for the family of GET order(s) methods, gnunet, 2020/07/05
- [taler-merchant] 230/277: add amount checks,
gnunet <=
- [taler-merchant] 232/277: 413 limits, gnunet, 2020/07/05
- [taler-merchant] 233/277: improved backenddb tests, gnunet, 2020/07/05
- [taler-merchant] 234/277: add missing notifications to private-get-orders long poller, gnunet, 2020/07/05
- [taler-merchant] 229/277: finish taler-merchant-httpd_reserves implementation, gnunet, 2020/07/05
- [taler-merchant] 235/277: Merge branch 'protocolV1' of git+ssh://git.taler.net/merchant into protocolV1, gnunet, 2020/07/05
- [taler-merchant] 240/277: Merge branch 'protocolV1' of ssh://git.taler.net/merchant into protocolV1, gnunet, 2020/07/05
- [taler-merchant] 238/277: return active-status of reserves from backenddb (fixes FIXMEs), gnunet, 2020/07/05
- [taler-merchant] 236/277: deeper checks for GET /private/instances/, gnunet, 2020/07/05
- [taler-merchant] 243/277: implement signature verification on pay response, gnunet, 2020/07/05
- [taler-merchant] 209/277: DCE, gnunet, 2020/07/05