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 (3186B)


      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       {
     44         struct TALER_EXCHANGEDB_MeltListEntry *melt = tl->details.melt;
     45 
     46         GNUNET_free (melt->transfer_pubs);
     47         GNUNET_free (melt->denom_pub_hashes);
     48         GNUNET_free (melt);
     49         break;
     50       }
     51     case TALER_EXCHANGEDB_TT_RECOUP_REFRESH_RECEIVER:
     52       {
     53         struct TALER_EXCHANGEDB_RecoupRefreshListEntry *rr;
     54 
     55         rr = tl->details.old_coin_recoup;
     56         TALER_denom_sig_free (&rr->coin.denom_sig);
     57         GNUNET_free (rr);
     58         break;
     59       }
     60     case TALER_EXCHANGEDB_TT_REFUND:
     61       GNUNET_free (tl->details.refund);
     62       break;
     63     case TALER_EXCHANGEDB_TT_RECOUP_WITHDRAW:
     64       GNUNET_free (tl->details.recoup);
     65       break;
     66     case TALER_EXCHANGEDB_TT_RECOUP_REFRESH:
     67       {
     68         struct TALER_EXCHANGEDB_RecoupRefreshListEntry *rr;
     69 
     70         rr = tl->details.recoup_refresh;
     71         TALER_denom_sig_free (&rr->coin.denom_sig);
     72         GNUNET_free (rr);
     73         break;
     74       }
     75     case TALER_EXCHANGEDB_TT_PURSE_DEPOSIT:
     76       {
     77         struct TALER_EXCHANGEDB_PurseDepositListEntry *deposit;
     78 
     79         deposit = tl->details.purse_deposit;
     80         GNUNET_free (deposit->exchange_base_url);
     81         GNUNET_free (deposit);
     82         break;
     83       }
     84     case TALER_EXCHANGEDB_TT_PURSE_REFUND:
     85       {
     86         struct TALER_EXCHANGEDB_PurseRefundListEntry *prefund;
     87 
     88         prefund = tl->details.purse_refund;
     89         GNUNET_free (prefund);
     90         break;
     91       }
     92     case TALER_EXCHANGEDB_TT_RESERVE_OPEN:
     93       {
     94         struct TALER_EXCHANGEDB_ReserveOpenListEntry *role;
     95 
     96         role = tl->details.reserve_open;
     97         GNUNET_free (role);
     98         break;
     99       }
    100     }
    101     {
    102       struct TALER_EXCHANGEDB_TransactionList *next;
    103 
    104       next = tl->next;
    105       GNUNET_free (tl);
    106       tl = next;
    107     }
    108   }
    109 }
    110 
    111 
    112 /* end of free_coin_transaction_list.c */