aboutsummaryrefslogtreecommitdiff
path: root/src/exchange-lib/exchange_api_deposit.c
diff options
context:
space:
mode:
authorJeff Burdges <burdges@gnunet.org>2016-05-25 03:33:46 +0200
committerJeff Burdges <burdges@gnunet.org>2016-05-25 03:33:46 +0200
commit6b615dcd9553b63f8ec345ab4d3e9f851b55b7aa (patch)
tree547264b36534ef2099c4a1d2ef61ad964cf89084 /src/exchange-lib/exchange_api_deposit.c
parent8dc035b237ad3b6f97b1430c5803826ef72310f4 (diff)
parent079ef7cb6f911d97a796acf621d2f1212dc9c282 (diff)
Merge branch 'master' of git.taler.net:/var/git/exchange
Diffstat (limited to 'src/exchange-lib/exchange_api_deposit.c')
-rw-r--r--src/exchange-lib/exchange_api_deposit.c51
1 files changed, 15 insertions, 36 deletions
diff --git a/src/exchange-lib/exchange_api_deposit.c b/src/exchange-lib/exchange_api_deposit.c
index 6ddfe6f6..f8c8367e 100644
--- a/src/exchange-lib/exchange_api_deposit.c
+++ b/src/exchange-lib/exchange_api_deposit.c
@@ -406,42 +406,21 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
(void) GNUNET_TIME_round_abs (&wire_deadline);
(void) GNUNET_TIME_round_abs (&refund_deadline);
- if (refund_deadline.abs_value_us > wire_deadline.abs_value_us)
- {
- GNUNET_break (0);
- return NULL;
- }
- if (GNUNET_YES !=
- MAH_handle_is_ready (exchange))
- {
- GNUNET_break (0);
- return NULL;
- }
+ GNUNET_assert (refund_deadline.abs_value_us <= wire_deadline.abs_value_us);
+ GNUNET_assert (GNUNET_YES ==
+ MAH_handle_is_ready (exchange));
/* initialize h_wire */
- if (GNUNET_OK !=
- TALER_JSON_hash (wire_details,
- &h_wire))
- {
- GNUNET_break (0);
- return NULL;
- }
+ GNUNET_assert (GNUNET_OK ==
+ TALER_JSON_hash (wire_details,
+ &h_wire));
key_state = TALER_EXCHANGE_get_keys (exchange);
dki = TALER_EXCHANGE_get_denomination_key (key_state,
denom_pub);
- if (NULL == dki)
- {
- TALER_LOG_WARNING ("Denomination key unknown to exchange\n");
- return NULL;
- }
- if (GNUNET_SYSERR ==
- TALER_amount_subtract (&amount_without_fee,
- amount,
- &dki->fee_deposit))
- {
- GNUNET_break (0);
- return NULL;
- }
-
+ GNUNET_assert (NULL != dki);
+ GNUNET_assert (GNUNET_SYSERR !=
+ TALER_amount_subtract (&amount_without_fee,
+ amount,
+ &dki->fee_deposit));
if (GNUNET_OK !=
verify_signatures (dki,
amount,
@@ -523,10 +502,10 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
strlen (dh->json_enc)));
ctx = MAH_handle_to_context (exchange);
dh->job = GNUNET_CURL_job_add (ctx,
- eh,
- GNUNET_YES,
- &handle_deposit_finished,
- dh);
+ eh,
+ GNUNET_YES,
+ &handle_deposit_finished,
+ dh);
return dh;
}