From 6b1f4904ef011760f2a5c30698ab62652594fa6c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 5 May 2016 14:43:13 +0200 Subject: export transaction history check function --- src/include/taler_exchange_service.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/include') diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 4fbadb79b..09cbd7868 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -1212,4 +1212,21 @@ void TALER_EXCHANGE_deposit_wtid_cancel (struct TALER_EXCHANGE_DepositWtidHandle *dwh); + +/** + * Convenience function. Verifies a coin's transaction history as + * returned by the exchange. + * + * @param currency expected currency for the coin + * @param coin_pub public key of the coin + * @param history history of the coin in json encoding + * @param[out] total how much of the coin has been spent according to @a history + * @return #GNUNET_OK if @a history is valid, #GNUNET_SYSERR if not + */ +int +TALER_EXCHANGE_verify_coin_history (const char *currency, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + json_t *history, + struct TALER_Amount *total); + #endif /* _TALER_EXCHANGE_SERVICE_H */ -- cgit v1.2.3