exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

free_coin_transaction_list.c (3016B)


      1 /*
      2   This file is part of TALER
      3   Copyright (C) 2015, 2016, 2020, 2024 Taler Systems SA
      4 
      5   TALER is free software; you can redistribute it and/or modify it under the
      6   terms of the GNU General Public License as published by the Free Software
      7   Foundation; either version 3, or (at your option) any later version.
      8 
      9   TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     10   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11   A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     12 
     13   You should have received a copy of the GNU General Public License along with
     14   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 */
     16 /**
     17  * @file exchangedb/free_coin_transaction_list.c
     18  * @brief Implementation to free the coin transaction list
     19  * @author Christian Grothoff
     20  */
     21 #include "platform.h"
     22 #include "exchange-database/free_coin_transaction_list.h"
     23 
     24 
     25 void
     26 TALER_EXCHANGEDB_free_coin_transaction_list (
     27   struct TALER_EXCHANGEDB_TransactionList *tl)
     28 {
     29   while (NULL != tl)
     30   {
     31     switch (tl->type)
     32     {
     33     case TALER_EXCHANGEDB_TT_DEPOSIT:
     34       {
     35         struct TALER_EXCHANGEDB_DepositListEntry *deposit;
     36 
     37         deposit = tl->details.deposit;
     38         GNUNET_free (deposit->receiver_wire_account.full_payto);
     39         GNUNET_free (deposit);
     40         break;
     41       }
     42     case TALER_EXCHANGEDB_TT_MELT:
     43       GNUNET_free (tl->details.melt);
     44       break;
     45     case TALER_EXCHANGEDB_TT_RECOUP_REFRESH_RECEIVER:
     46       {
     47         struct TALER_EXCHANGEDB_RecoupRefreshListEntry *rr;
     48 
     49         rr = tl->details.old_coin_recoup;
     50         TALER_denom_sig_free (&rr->coin.denom_sig);
     51         GNUNET_free (rr);
     52         break;
     53       }
     54     case TALER_EXCHANGEDB_TT_REFUND:
     55       GNUNET_free (tl->details.refund);
     56       break;
     57     case TALER_EXCHANGEDB_TT_RECOUP_WITHDRAW:
     58       GNUNET_free (tl->details.recoup);
     59       break;
     60     case TALER_EXCHANGEDB_TT_RECOUP_REFRESH:
     61       {
     62         struct TALER_EXCHANGEDB_RecoupRefreshListEntry *rr;
     63 
     64         rr = tl->details.recoup_refresh;
     65         TALER_denom_sig_free (&rr->coin.denom_sig);
     66         GNUNET_free (rr);
     67         break;
     68       }
     69     case TALER_EXCHANGEDB_TT_PURSE_DEPOSIT:
     70       {
     71         struct TALER_EXCHANGEDB_PurseDepositListEntry *deposit;
     72 
     73         deposit = tl->details.purse_deposit;
     74         GNUNET_free (deposit->exchange_base_url);
     75         GNUNET_free (deposit);
     76         break;
     77       }
     78     case TALER_EXCHANGEDB_TT_PURSE_REFUND:
     79       {
     80         struct TALER_EXCHANGEDB_PurseRefundListEntry *prefund;
     81 
     82         prefund = tl->details.purse_refund;
     83         GNUNET_free (prefund);
     84         break;
     85       }
     86     case TALER_EXCHANGEDB_TT_RESERVE_OPEN:
     87       {
     88         struct TALER_EXCHANGEDB_ReserveOpenListEntry *role;
     89 
     90         role = tl->details.reserve_open;
     91         GNUNET_free (role);
     92         break;
     93       }
     94     }
     95     {
     96       struct TALER_EXCHANGEDB_TransactionList *next;
     97 
     98       next = tl->next;
     99       GNUNET_free (tl);
    100       tl = next;
    101     }
    102   }
    103 }
    104 
    105 
    106 /* end of free_coin_transaction_list.c */