aboutsummaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_db.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-12-08 20:33:14 +0100
committerChristian Grothoff <christian@grothoff.org>2021-12-08 20:33:14 +0100
commite0700ad9164867c9209beec09b8001f1741eea15 (patch)
tree1fec321f0d991836b6f2274e14f8b50bb55be9c2 /src/exchange/taler-exchange-httpd_db.h
parent21951eacc23611464ada18c99dfb4633b9fcc1b0 (diff)
optimize /deposit logic to minimize serialization failures (presumably)
Diffstat (limited to 'src/exchange/taler-exchange-httpd_db.h')
-rw-r--r--src/exchange/taler-exchange-httpd_db.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_db.h b/src/exchange/taler-exchange-httpd_db.h
index 83302235..60885dbd 100644
--- a/src/exchange/taler-exchange-httpd_db.h
+++ b/src/exchange/taler-exchange-httpd_db.h
@@ -42,6 +42,32 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin,
/**
+ * Check that a coin has an adequate balance so that we can
+ * commit the current transaction. If the balance is
+ * insufficient for all transactions associated with the
+ * coin, return a hard error.
+ *
+ * @param connection HTTP connection to report hard errors on
+ * @param coin_pub coin to analyze
+ * @param coin_value total value of the original coin (by denomination)
+ * @param op_cost cost of the current operation (for error reporting)
+ * @param check_recoup should we include recoup transactions in the check
+ * @param zombie_required additional requirement that the coin must
+ * be a zombie coin, or also hard failure
+ * @param[out] mhd_ret set to response status code, on hard error only
+ * @return transaction status
+ */
+enum GNUNET_DB_QueryStatus
+TEH_check_coin_balance (struct MHD_Connection *connection,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_Amount *coin_value,
+ const struct TALER_Amount *op_cost,
+ bool check_recoup,
+ bool zombie_required,
+ MHD_RESULT *mhd_ret);
+
+
+/**
* Function implementing a database transaction. Runs 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