summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_deposit.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-01-17 19:54:16 +0100
committerChristian Grothoff <christian@grothoff.org>2020-01-17 19:54:16 +0100
commit11c52837112421af755bc7bc21569011274909ad (patch)
tree68c44a348c9189daad2d0b9f4c72468514f257ca /src/lib/exchange_api_deposit.c
parent33bd1ca2bbd61019b224c9de8ac48126d0a57ab0 (diff)
downloadexchange-11c52837112421af755bc7bc21569011274909ad.tar.gz
exchange-11c52837112421af755bc7bc21569011274909ad.tar.bz2
exchange-11c52837112421af755bc7bc21569011274909ad.zip
prepare API to enable verification of fees in coin history check
Diffstat (limited to 'src/lib/exchange_api_deposit.c')
-rw-r--r--src/lib/exchange_api_deposit.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c
index 69584ee2..23ec8a3b 100644
--- a/src/lib/exchange_api_deposit.c
+++ b/src/lib/exchange_api_deposit.c
@@ -101,9 +101,10 @@ struct TALER_EXCHANGE_DepositHandle
struct TALER_Amount amount_with_fee;
/**
- * Total value of the coin being transacted with.
+ * @brief Public information about the coin's denomination key.
+ * Note that the "key" field itself has been zero'ed out.
*/
- struct TALER_Amount coin_value;
+ struct TALER_EXCHANGE_DenomPublicKey dki;
/**
* Chance that we will inform the auditor about the deposit
@@ -250,7 +251,8 @@ verify_deposit_signature_forbidden (const struct
history = json_object_get (json,
"history");
if (GNUNET_OK !=
- TALER_EXCHANGE_verify_coin_history (dh->coin_value.currency,
+ TALER_EXCHANGE_verify_coin_history (&dh->dki,
+ dh->dki.value.currency,
&dh->depconf.coin_pub,
history,
&total))
@@ -269,7 +271,7 @@ verify_deposit_signature_forbidden (const struct
}
if (0 >= TALER_amount_cmp (&total,
- &dh->coin_value))
+ &dh->dki.value))
{
/* transaction should have still fit */
GNUNET_break (0);
@@ -604,7 +606,9 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
dh->depconf.coin_pub = *coin_pub;
dh->depconf.merchant = *merchant_pub;
dh->amount_with_fee = *amount;
- dh->coin_value = dki->value;
+ dh->dki = *dki;
+ dh->dki.key.rsa_public_key = NULL; /* lifetime not warranted, so better
+ not copy the pointer */
eh = TEL_curl_easy_get (dh->url);
if (GNUNET_OK !=