diff options
Diffstat (limited to 'src/exchange/taler-exchange-httpd_db.h')
-rw-r--r-- | src/exchange/taler-exchange-httpd_db.h | 26 |
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 |