aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_deposits_get.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/exchange_api_deposits_get.c')
-rw-r--r--src/lib/exchange_api_deposits_get.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/lib/exchange_api_deposits_get.c b/src/lib/exchange_api_deposits_get.c
index 6a2ad5c3d..004a24d42 100644
--- a/src/lib/exchange_api_deposits_get.c
+++ b/src/lib/exchange_api_deposits_get.c
@@ -146,16 +146,13 @@ handle_deposit_wtid_finished (void *cls,
146 break; 146 break;
147 case MHD_HTTP_OK: 147 case MHD_HTTP_OK:
148 { 148 {
149 struct GNUNET_TIME_Absolute execution_time; 149 struct TALER_EXCHANGE_DepositData dd;
150 struct TALER_Amount coin_contribution;
151 struct TALER_ExchangePublicKeyP exchange_pub;
152 struct TALER_ExchangeSignatureP exchange_sig;
153 struct GNUNET_JSON_Specification spec[] = { 150 struct GNUNET_JSON_Specification spec[] = {
154 GNUNET_JSON_spec_fixed_auto ("wtid", &dwh->depconf.wtid), 151 GNUNET_JSON_spec_fixed_auto ("wtid", &dwh->depconf.wtid),
155 GNUNET_JSON_spec_absolute_time ("execution_time", &execution_time), 152 GNUNET_JSON_spec_absolute_time ("execution_time", &dd.execution_time),
156 TALER_JSON_spec_amount ("coin_contribution", &coin_contribution), 153 TALER_JSON_spec_amount ("coin_contribution", &dd.coin_contribution),
157 GNUNET_JSON_spec_fixed_auto ("exchange_sig", &exchange_sig), 154 GNUNET_JSON_spec_fixed_auto ("exchange_sig", &dd.exchange_sig),
158 GNUNET_JSON_spec_fixed_auto ("exchange_pub", &exchange_pub), 155 GNUNET_JSON_spec_fixed_auto ("exchange_pub", &dd.exchange_pub),
159 GNUNET_JSON_spec_end () 156 GNUNET_JSON_spec_end ()
160 }; 157 };
161 158
@@ -169,14 +166,15 @@ handle_deposit_wtid_finished (void *cls,
169 hr.ec = TALER_EC_DEPOSITS_INVALID_BODY_BY_EXCHANGE; 166 hr.ec = TALER_EC_DEPOSITS_INVALID_BODY_BY_EXCHANGE;
170 break; 167 break;
171 } 168 }
172 dwh->depconf.execution_time = GNUNET_TIME_absolute_hton (execution_time); 169 dwh->depconf.execution_time = GNUNET_TIME_absolute_hton (
170 dd.execution_time);
173 TALER_amount_hton (&dwh->depconf.coin_contribution, 171 TALER_amount_hton (&dwh->depconf.coin_contribution,
174 &coin_contribution); 172 &dd.coin_contribution);
175 if (GNUNET_OK != 173 if (GNUNET_OK !=
176 verify_deposit_wtid_signature_ok (dwh, 174 verify_deposit_wtid_signature_ok (dwh,
177 j, 175 j,
178 &exchange_pub, 176 &dd.exchange_pub,
179 &exchange_sig)) 177 &dd.exchange_sig))
180 { 178 {
181 GNUNET_break_op (0); 179 GNUNET_break_op (0);
182 hr.http_status = 0; 180 hr.http_status = 0;
@@ -184,14 +182,7 @@ handle_deposit_wtid_finished (void *cls,
184 } 182 }
185 else 183 else
186 { 184 {
187 struct TALER_EXCHANGE_DepositData dd = { 185 dd.wtid = dwh->depconf.wtid;
188 .exchange_pub = &exchange_pub,
189 .exchange_sig = &exchange_sig,
190 .wtid = &dwh->depconf.wtid,
191 .execution_time = execution_time,
192 .coin_contribution = &coin_contribution
193 };
194
195 dwh->cb (dwh->cb_cls, 186 dwh->cb (dwh->cb_cls,
196 &hr, 187 &hr,
197 &dd); 188 &dd);