summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_deposit.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-05-25 21:34:18 +0200
committerChristian Grothoff <christian@grothoff.org>2021-05-25 21:34:18 +0200
commit068068f40fc97f09525aaccf560a1be352abd159 (patch)
treeb4331505e2c538d591a755352aaeee912d6cac6f /src/exchange/taler-exchange-httpd_deposit.c
parent0d1ab614c06f60f79de75a0f2ec30c33a69820dd (diff)
downloadexchange-068068f40fc97f09525aaccf560a1be352abd159.tar.gz
exchange-068068f40fc97f09525aaccf560a1be352abd159.tar.bz2
exchange-068068f40fc97f09525aaccf560a1be352abd159.zip
return signed error message with HTTP_GONE status if denomination is not currently valid for specified operation (#6889)
Diffstat (limited to 'src/exchange/taler-exchange-httpd_deposit.c')
-rw-r--r--src/exchange/taler-exchange-httpd_deposit.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/exchange/taler-exchange-httpd_deposit.c b/src/exchange/taler-exchange-httpd_deposit.c
index 44c3d14c..f0f6784f 100644
--- a/src/exchange/taler-exchange-httpd_deposit.c
+++ b/src/exchange/taler-exchange-httpd_deposit.c
@@ -443,35 +443,39 @@ TEH_handler_deposit (struct MHD_Connection *connection,
return mret;
}
now = GNUNET_TIME_absolute_get ();
+ (void) GNUNET_TIME_round_abs (&now);
if (now.abs_value_us >= dk->meta.expire_deposit.abs_value_us)
{
/* This denomination is past the expiration time for deposits */
GNUNET_JSON_parse_free (spec);
- return TALER_MHD_reply_with_error (
+ return TEH_RESPONSE_reply_expired_denom_pub_hash (
connection,
- MHD_HTTP_GONE,
+ &deposit.coin.denom_pub_hash,
+ now,
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_EXPIRED,
- NULL);
+ "DEPOSIT");
}
if (now.abs_value_us < dk->meta.start.abs_value_us)
{
/* This denomination is not yet valid */
GNUNET_JSON_parse_free (spec);
- return TALER_MHD_reply_with_error (
+ return TEH_RESPONSE_reply_expired_denom_pub_hash (
connection,
- MHD_HTTP_PRECONDITION_FAILED,
+ &deposit.coin.denom_pub_hash,
+ now,
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE,
- NULL);
+ "DEPOSIT");
}
if (dk->recoup_possible)
{
/* This denomination has been revoked */
GNUNET_JSON_parse_free (spec);
- return TALER_MHD_reply_with_error (
+ return TEH_RESPONSE_reply_expired_denom_pub_hash (
connection,
- MHD_HTTP_GONE,
+ &deposit.coin.denom_pub_hash,
+ now,
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_REVOKED,
- NULL);
+ "DEPOSIT");
}
deposit.deposit_fee = dk->meta.fee_deposit;