gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] 01/04: handle TALER_EXCHANGEDB_TT_PAYBACK


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] 01/04: handle TALER_EXCHANGEDB_TT_PAYBACK in DB balance calulations
Date: Mon, 03 Apr 2017 16:37:27 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

commit e8f7674ca44d705df13ff1d562a92280e215d52e
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Apr 3 13:57:17 2017 +0200

    handle  TALER_EXCHANGEDB_TT_PAYBACK in DB balance calulations
---
 src/exchange/taler-exchange-httpd_db.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/exchange/taler-exchange-httpd_db.c 
b/src/exchange/taler-exchange-httpd_db.c
index 604de24..23a5929 100644
--- a/src/exchange/taler-exchange-httpd_db.c
+++ b/src/exchange/taler-exchange-httpd_db.c
@@ -178,6 +178,17 @@ calculate_transaction_list_totals (struct 
TALER_EXCHANGEDB_TransactionList *tl,
         return GNUNET_SYSERR;
       }
       break;
+    case TALER_EXCHANGEDB_TT_PAYBACK:
+      /* spent += pos->value */
+      if (GNUNET_OK !=
+          TALER_amount_add (&spent,
+                            &spent,
+                            &pos->details.payback->value))
+      {
+        GNUNET_break (0);
+        return GNUNET_SYSERR;
+      }
+      break;
     }
   }
   /* spent = spent - refunded */
@@ -429,6 +440,9 @@ TEH_DB_execute_refund (struct MHD_Connection *connection,
         }
       }
       break;
+    case TALER_EXCHANGEDB_TT_PAYBACK:
+      /* Paybacks cannot be refunded, ignore here */
+      break;
     }
   }
   /* handle if deposit was NOT found */

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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