diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-01-17 19:54:16 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-01-17 19:54:16 +0100 |
commit | 11c52837112421af755bc7bc21569011274909ad (patch) | |
tree | 68c44a348c9189daad2d0b9f4c72468514f257ca /src/lib/exchange_api_deposit.c | |
parent | 33bd1ca2bbd61019b224c9de8ac48126d0a57ab0 (diff) |
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.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c index 69584ee24..23ec8a3bd 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 != |