diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2022-04-01 16:39:07 +0200 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2022-04-01 16:39:07 +0200 |
commit | caf66486e70d896b1dd4eca3785fd42185a540cd (patch) | |
tree | bc4323b6fc7d1e256b485daaf7c20bdfa9037cfd /src/exchange/taler-exchange-httpd_deposit.c | |
parent | 747ae5ef094731650911838a51e49db778b18ab6 (diff) | |
download | exchange-caf66486e70d896b1dd4eca3785fd42185a540cd.tar.gz exchange-caf66486e70d896b1dd4eca3785fd42185a540cd.tar.bz2 exchange-caf66486e70d896b1dd4eca3785fd42185a540cd.zip |
work on purse creation logic
Diffstat (limited to 'src/exchange/taler-exchange-httpd_deposit.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_deposit.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/exchange/taler-exchange-httpd_deposit.c b/src/exchange/taler-exchange-httpd_deposit.c index 59d25904f..011f5f159 100644 --- a/src/exchange/taler-exchange-httpd_deposit.c +++ b/src/exchange/taler-exchange-httpd_deposit.c @@ -178,7 +178,6 @@ deposit_transaction (void *cls, } if (in_conflict) { - TEH_plugin->rollback (TEH_plugin->cls); *mhd_ret = TEH_RESPONSE_reply_coin_insufficient_funds ( connection, @@ -188,7 +187,6 @@ deposit_transaction (void *cls, } if (! balance_ok) { - TEH_plugin->rollback (TEH_plugin->cls); *mhd_ret = TEH_RESPONSE_reply_coin_insufficient_funds ( connection, @@ -323,6 +321,16 @@ TEH_handler_deposit (struct MHD_Connection *connection, GNUNET_JSON_parse_free (spec); return mret; } + if (0 > TALER_amount_cmp (&dk->meta.value, + &deposit.amount_with_fee)) + { + GNUNET_break_op (0); + GNUNET_JSON_parse_free (spec); + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_EXCHANGE_GENERIC_AMOUNT_EXCEEDS_DENOMINATION_VALUE, + NULL); + } if (GNUNET_TIME_absolute_is_past (dk->meta.expire_deposit.abs_time)) { /* This denomination is past the expiration time for deposits */ |