gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: fix #6553: compute residual coin


From: gnunet
Subject: [taler-exchange] branch master updated: fix #6553: compute residual coin value correctly in melt conflict response
Date: Tue, 01 Sep 2020 23:59:22 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new ee4f1c10 fix #6553: compute residual coin value correctly in melt 
conflict response
ee4f1c10 is described below

commit ee4f1c1002f84118b7f0de592e505d3915437ad5
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Sep 1 23:59:16 2020 +0200

    fix #6553: compute residual coin value correctly in melt conflict response
---
 contrib/gana                             |  2 +-
 src/exchange/taler-exchange-httpd_melt.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/contrib/gana b/contrib/gana
index 18a39c29..0b778cda 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit 18a39c29726860af58800a28454446154b89832b
+Subproject commit 0b778cdac372d0b75f3b64501a15a21c9c57f36e
diff --git a/src/exchange/taler-exchange-httpd_melt.c 
b/src/exchange/taler-exchange-httpd_melt.c
index f276a72b..87238954 100644
--- a/src/exchange/taler-exchange-httpd_melt.c
+++ b/src/exchange/taler-exchange-httpd_melt.c
@@ -254,11 +254,20 @@ refresh_check_melt (struct MHD_Connection *connection,
                             &spent))
   {
     struct TALER_Amount coin_residual;
+    struct TALER_Amount spent_already;
 
+    /* First subtract the melt cost from 'spent' to
+       compute the total amount already spent of the coin */
     GNUNET_assert (0 <=
-                   TALER_amount_subtract (&coin_residual,
+                   TALER_amount_subtract (&spent_already,
                                           &spent,
                                           
&rmc->refresh_session.amount_with_fee));
+    /* The residual coin value is the original coin value minus
+       what we have spent (before the melt) */
+    GNUNET_assert (0 <=
+                   TALER_amount_subtract (&coin_residual,
+                                          &rmc->coin_value,
+                                          &spent_already));
     *mhd_ret = reply_melt_insufficient_funds (
       connection,
       &rmc->refresh_session.coin.coin_pub,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]