aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-04-03 13:57:17 +0200
committerChristian Grothoff <christian@grothoff.org>2017-04-03 13:57:17 +0200
commite8f7674ca44d705df13ff1d562a92280e215d52e (patch)
treea118fad6712bba088bccdfc5c8e8a3a72ed8f795 /src
parent94e9ba87101e09138d9cf083d630bf37935b3ea3 (diff)
handle TALER_EXCHANGEDB_TT_PAYBACK in DB balance calulations
Diffstat (limited to 'src')
-rw-r--r--src/exchange/taler-exchange-httpd_db.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_db.c b/src/exchange/taler-exchange-httpd_db.c
index 604de24a6..23a592963 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 */