diff options
| author | Christian Grothoff <christian@grothoff.org> | 2022-06-02 21:55:21 +0200 | 
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2022-06-02 21:55:21 +0200 | 
| commit | 04c32eafb9194727876469c92b7cbedc008c51ec (patch) | |
| tree | ae879e12757e0939c3bed52fad2c9b1ac33e769f /src/lib | |
| parent | 5dd03fe359f541f7e1e4849ed4bd38259200f4df (diff) | |
-work on P2P payment details
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/exchange_api_common.c | 20 | 
1 files changed, 17 insertions, 3 deletions
| diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c index cfab9a30..78dea63e 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); | 
