From fa5582930e6198e2783ae9cad59d2d2b4ce2ee1a Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Thu, 21 Dec 2023 23:57:23 +0100 Subject: [wip, #7267] more refined denomination conflict response during deposit If a coin was known but with a different denomination, return to the client an error response that contains the denomination's public key and the corresponding signature of the provided coin. --- src/exchange/taler-exchange-httpd_responses.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/exchange/taler-exchange-httpd_responses.h') diff --git a/src/exchange/taler-exchange-httpd_responses.h b/src/exchange/taler-exchange-httpd_responses.h index b10a72824..57aeefe42 100644 --- a/src/exchange/taler-exchange-httpd_responses.h +++ b/src/exchange/taler-exchange-httpd_responses.h @@ -160,6 +160,28 @@ TEH_RESPONSE_reply_coin_insufficient_funds ( const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub); +/** + * Send proof that a request is invalid to client because of + * an conflict with the provided denomination (the exchange had seen + * this coin before, signed by a different denomination). + * This function will create a message with the denomination's public key + * that was seen before. + * + * @param connection connection to the client + * @param ec error code to return + * @param coin_pub the public key of the coin + * @param prev_denom_pub the denomination of the coin, as seen previously + * @param prev_denom_sig the signature with the denomination key over the coin + * @return MHD result code + */ +MHD_RESULT +TEH_RESPONSE_reply_coin_denomination_conflict ( + struct MHD_Connection *connection, + enum TALER_ErrorCode ec, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_DenominationPublicKey *prev_denom_pub, + const struct TALER_DenominationSignature *prev_denom_sig); + /** * Send proof that a request is invalid to client because of * a conflicting value for the age commitment hash of a coin. -- cgit v1.2.3