aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_common.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2022-02-22 18:35:10 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2022-02-22 18:35:10 +0100
commit7910ca183f40a544dae4add5e7b5ff4775e65e12 (patch)
treec7ea92bc5f255c94f17e8359a2cc611c1b1ec872 /src/lib/exchange_api_common.c
parentfbdc1996a6166893415c59ed830e75a8ccf79a51 (diff)
downloadexchange-7910ca183f40a544dae4add5e7b5ff4775e65e12.tar.xz
double melt test no works with age restriction
- added missing field h_age_commitment in exchange's error response - slight refactoring
Diffstat (limited to 'src/lib/exchange_api_common.c')
-rw-r--r--src/lib/exchange_api_common.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c
index b7a43bbc8..160f62dc6 100644
--- a/src/lib/exchange_api_common.c
+++ b/src/lib/exchange_api_common.c
@@ -477,7 +477,7 @@ TALER_EXCHANGE_verify_coin_history (
struct TALER_MerchantPublicKeyP merchant_pub;
struct GNUNET_TIME_Timestamp refund_deadline = {0};
struct TALER_CoinSpendSignatureP sig;
- struct TALER_AgeCommitmentHash *hac = NULL;
+ struct TALER_AgeCommitmentHash hac = {0};
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("coin_sig",
&sig),
@@ -487,6 +487,9 @@ TALER_EXCHANGE_verify_coin_history (
&h_wire),
GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
h_denom_pub),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_fixed_auto ("h_age_commitment",
+ &hac)),
GNUNET_JSON_spec_timestamp ("timestamp",
&wallet_timestamp),
GNUNET_JSON_spec_mark_optional (
@@ -508,18 +511,19 @@ TALER_EXCHANGE_verify_coin_history (
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
- TALER_wallet_deposit_verify (&amount,
- &fee,
- &h_wire,
- &h_contract_terms,
- hac,
- NULL /* h_extensions! */,
- h_denom_pub,
- wallet_timestamp,
- &merchant_pub,
- refund_deadline,
- coin_pub,
- &sig))
+ TALER_wallet_deposit_verify (
+ &amount,
+ &fee,
+ &h_wire,
+ &h_contract_terms,
+ TALER_AgeCommitmentHash_isNullOrZero (&hac) ? NULL : &hac,
+ NULL /* h_extensions! */,
+ h_denom_pub,
+ wallet_timestamp,
+ &merchant_pub,
+ refund_deadline,
+ coin_pub,
+ &sig))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;