summaryrefslogtreecommitdiff
path: root/src/exchangedb/plugin_exchangedb_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/plugin_exchangedb_common.c')
-rw-r--r--src/exchangedb/plugin_exchangedb_common.c99
1 files changed, 73 insertions, 26 deletions
diff --git a/src/exchangedb/plugin_exchangedb_common.c b/src/exchangedb/plugin_exchangedb_common.c
index fb697dae8..562710eaa 100644
--- a/src/exchangedb/plugin_exchangedb_common.c
+++ b/src/exchangedb/plugin_exchangedb_common.c
@@ -19,16 +19,14 @@
* included in each plugin.
* @author Christian Grothoff
*/
+#include "platform.h"
+#include "plugin_exchangedb_common.h"
-/**
- * Free memory associated with the given reserve history.
- *
- * @param cls the @e cls of this struct with the plugin-specific state (unused)
- * @param rh history to free.
- */
-static void
-common_free_reserve_history (void *cls,
- struct TALER_EXCHANGEDB_ReserveHistory *rh)
+
+void
+TEH_COMMON_free_reserve_history (
+ void *cls,
+ struct TALER_EXCHANGEDB_ReserveHistory *rh)
{
(void) cls;
while (NULL != rh)
@@ -49,7 +47,7 @@ common_free_reserve_history (void *cls,
struct TALER_EXCHANGEDB_CollectableBlindcoin *cbc;
cbc = rh->details.withdraw;
- GNUNET_CRYPTO_rsa_signature_free (cbc->sig.rsa_signature);
+ TALER_blinded_denom_sig_free (&cbc->sig);
GNUNET_free (cbc);
break;
}
@@ -58,7 +56,7 @@ common_free_reserve_history (void *cls,
struct TALER_EXCHANGEDB_Recoup *recoup;
recoup = rh->details.recoup;
- GNUNET_CRYPTO_rsa_signature_free (recoup->coin.denom_sig.rsa_signature);
+ TALER_denom_sig_free (&recoup->coin.denom_sig);
GNUNET_free (recoup);
break;
}
@@ -71,6 +69,38 @@ common_free_reserve_history (void *cls,
GNUNET_free (closing);
break;
}
+ case TALER_EXCHANGEDB_RO_PURSE_MERGE:
+ {
+ struct TALER_EXCHANGEDB_PurseMerge *merge;
+
+ merge = rh->details.merge;
+ GNUNET_free (merge);
+ break;
+ }
+ case TALER_EXCHANGEDB_RO_HISTORY_REQUEST:
+ {
+ struct TALER_EXCHANGEDB_HistoryRequest *history;
+
+ history = rh->details.history;
+ GNUNET_free (history);
+ break;
+ }
+ case TALER_EXCHANGEDB_RO_OPEN_REQUEST:
+ {
+ struct TALER_EXCHANGEDB_OpenRequest *or;
+
+ or = rh->details.open_request;
+ GNUNET_free (or);
+ break;
+ }
+ case TALER_EXCHANGEDB_RO_CLOSE_REQUEST:
+ {
+ struct TALER_EXCHANGEDB_CloseRequest *cr;
+
+ cr = rh->details.close_request;
+ GNUNET_free (cr);
+ break;
+ }
}
{
struct TALER_EXCHANGEDB_ReserveHistory *next;
@@ -83,15 +113,10 @@ common_free_reserve_history (void *cls,
}
-/**
- * Free linked list of transactions.
- *
- * @param cls the @e cls of this struct with the plugin-specific state (unused)
- * @param tl list to free
- */
-static void
-common_free_coin_transaction_list (void *cls,
- struct TALER_EXCHANGEDB_TransactionList *tl)
+void
+TEH_COMMON_free_coin_transaction_list (
+ void *cls,
+ struct TALER_EXCHANGEDB_TransactionList *tl)
{
(void) cls;
while (NULL != tl)
@@ -103,8 +128,7 @@ common_free_coin_transaction_list (void *cls,
struct TALER_EXCHANGEDB_DepositListEntry *deposit;
deposit = tl->details.deposit;
- if (NULL != deposit->receiver_wire_account)
- json_decref (deposit->receiver_wire_account);
+ GNUNET_free (deposit->receiver_wire_account);
GNUNET_free (deposit);
break;
}
@@ -116,8 +140,7 @@ common_free_coin_transaction_list (void *cls,
struct TALER_EXCHANGEDB_RecoupRefreshListEntry *rr;
rr = tl->details.old_coin_recoup;
- if (NULL != rr->coin.denom_sig.rsa_signature)
- GNUNET_CRYPTO_rsa_signature_free (rr->coin.denom_sig.rsa_signature);
+ TALER_denom_sig_free (&rr->coin.denom_sig);
GNUNET_free (rr);
break;
}
@@ -132,11 +155,35 @@ common_free_coin_transaction_list (void *cls,
struct TALER_EXCHANGEDB_RecoupRefreshListEntry *rr;
rr = tl->details.recoup_refresh;
- if (NULL != rr->coin.denom_sig.rsa_signature)
- GNUNET_CRYPTO_rsa_signature_free (rr->coin.denom_sig.rsa_signature);
+ TALER_denom_sig_free (&rr->coin.denom_sig);
GNUNET_free (rr);
break;
}
+ case TALER_EXCHANGEDB_TT_PURSE_DEPOSIT:
+ {
+ struct TALER_EXCHANGEDB_PurseDepositListEntry *deposit;
+
+ deposit = tl->details.purse_deposit;
+ GNUNET_free (deposit->exchange_base_url);
+ GNUNET_free (deposit);
+ break;
+ }
+ case TALER_EXCHANGEDB_TT_PURSE_REFUND:
+ {
+ struct TALER_EXCHANGEDB_PurseRefundListEntry *prefund;
+
+ prefund = tl->details.purse_refund;
+ GNUNET_free (prefund);
+ break;
+ }
+ case TALER_EXCHANGEDB_TT_RESERVE_OPEN:
+ {
+ struct TALER_EXCHANGEDB_ReserveOpenListEntry *role;
+
+ role = tl->details.reserve_open;
+ GNUNET_free (role);
+ break;
+ }
}
{
struct TALER_EXCHANGEDB_TransactionList *next;