summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_common.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-06-02 21:55:21 +0200
committerChristian Grothoff <christian@grothoff.org>2022-06-02 21:55:21 +0200
commit04c32eafb9194727876469c92b7cbedc008c51ec (patch)
treeae879e12757e0939c3bed52fad2c9b1ac33e769f /src/lib/exchange_api_common.c
parent5dd03fe359f541f7e1e4849ed4bd38259200f4df (diff)
downloadexchange-04c32eafb9194727876469c92b7cbedc008c51ec.tar.gz
exchange-04c32eafb9194727876469c92b7cbedc008c51ec.tar.bz2
exchange-04c32eafb9194727876469c92b7cbedc008c51ec.zip
-work on P2P payment details
Diffstat (limited to 'src/lib/exchange_api_common.c')
-rw-r--r--src/lib/exchange_api_common.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c
index cfab9a305..78dea63e4 100644
--- a/src/lib/exchange_api_common.c
+++ b/src/lib/exchange_api_common.c
@@ -417,6 +417,8 @@ parse_merge (struct TALER_EXCHANGE_ReserveHistoryEntry *rh,
&rh->details.merge_details.merge_timestamp),
GNUNET_JSON_spec_timestamp ("purse_expiration",
&rh->details.merge_details.purse_expiration),
+ GNUNET_JSON_spec_bool ("merged",
+ &rh->details.merge_details.merged),
GNUNET_JSON_spec_end ()
};
@@ -447,10 +449,22 @@ parse_merge (struct TALER_EXCHANGE_ReserveHistoryEntry *rh,
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
+ if (rh->details.merge_details.merged)
+ {
+ if (0 >
+ TALER_amount_add (uc->total_in,
+ uc->total_in,
+ &rh->amount))
+ {
+ /* overflow in history already!? inconceivable! Bad exchange! */
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
+ }
if (0 >
- TALER_amount_add (uc->total_in,
- uc->total_in,
- &rh->amount))
+ TALER_amount_add (uc->total_out,
+ uc->total_out,
+ &rh->details.merge_details.purse_fee))
{
/* overflow in history already!? inconceivable! Bad exchange! */
GNUNET_break_op (0);