summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_db.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange/taler-exchange-httpd_db.h')
-rw-r--r--src/exchange/taler-exchange-httpd_db.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_db.h b/src/exchange/taler-exchange-httpd_db.h
index 2a42bcd8..091421bb 100644
--- a/src/exchange/taler-exchange-httpd_db.h
+++ b/src/exchange/taler-exchange-httpd_db.h
@@ -24,6 +24,45 @@
#include <microhttpd.h>
#include "taler_exchangedb_plugin.h"
+
+/**
+ * Type of closure for #TEH_DB_know_coin_transaction.
+ */
+struct TEH_DB_KnowCoinContext
+{
+ /**
+ * The coin to make sure it is known.
+ */
+ const struct TALER_CoinPublicInfo *coin;
+
+ /**
+ * MHD connection to queue errors with.
+ */
+ struct MHD_Connection *connection;
+};
+
+
+/**
+ * Execute database transaction to ensure coin is known. Run the transaction
+ * logic; IF it returns a non-error code, the transaction logic MUST
+ * NOT queue a MHD response. IF it returns an hard error, the
+ * transaction logic MUST queue a MHD response and set @a mhd_ret. IF
+ * it returns the soft error code, the function MAY be called again to
+ * retry and MUST not queue a MHD response.
+ *
+ * @param cls a `struct DepositContext`
+ * @param connection MHD request context
+ * @param session database session and transaction to use
+ * @param[out] mhd_ret set to MHD status on error
+ * @return transaction status
+ */
+enum GNUNET_DB_QueryStatus
+TEH_DB_know_coin_transaction (void *cls,
+ struct MHD_Connection *connection,
+ struct TALER_EXCHANGEDB_Session *session,
+ int *mhd_ret);
+
+
/**
* Function implementing a database transaction. Runs the transaction
* logic; IF it returns a non-error code, the transaction logic MUST