summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_refund.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-14 17:12:25 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-14 17:12:48 +0100
commit04f2e9a4d5b64000b5e29b4603c9bc57c732c4f7 (patch)
tree5022fd75fe7dd2facd939c71f39657fab7964da9 /src/exchange/taler-exchange-httpd_refund.c
parentb5d88fc2d1832fd27bdd7df0860c07ae3c61312c (diff)
downloadexchange-04f2e9a4d5b64000b5e29b4603c9bc57c732c4f7.tar.gz
exchange-04f2e9a4d5b64000b5e29b4603c9bc57c732c4f7.tar.bz2
exchange-04f2e9a4d5b64000b5e29b4603c9bc57c732c4f7.zip
(start to) remove logic no longer needed with new key management
Diffstat (limited to 'src/exchange/taler-exchange-httpd_refund.c')
-rw-r--r--src/exchange/taler-exchange-httpd_refund.c67
1 files changed, 25 insertions, 42 deletions
diff --git a/src/exchange/taler-exchange-httpd_refund.c b/src/exchange/taler-exchange-httpd_refund.c
index 6bb94348..ace6e28f 100644
--- a/src/exchange/taler-exchange-httpd_refund.c
+++ b/src/exchange/taler-exchange-httpd_refund.c
@@ -32,7 +32,6 @@
#include "taler_mhd_lib.h"
#include "taler-exchange-httpd_refund.h"
#include "taler-exchange-httpd_responses.h"
-#include "taler-exchange-httpd_keystate.h"
#include "taler-exchange-httpd_keys.h"
@@ -448,52 +447,36 @@ verify_and_execute_refund (struct MHD_Connection *connection,
}
{
- struct TEH_KS_StateHandle *key_state;
-
- key_state = TEH_KS_acquire (GNUNET_TIME_absolute_get ());
- if (NULL == key_state)
+ /* Obtain information about the coin's denomination! */
+ struct TEH_DenominationKey *dk;
+ unsigned int hc;
+ enum TALER_ErrorCode ec;
+
+ dk = TEH_keys_denomination_by_hash (&denom_hash,
+ &ec,
+ &hc);
+ if (NULL == dk)
{
- TALER_LOG_ERROR ("Lacking keys to operate\n");
+ /* DKI not found, but we do have a coin with this DK in our database;
+ not good... */
+ GNUNET_break (0);
return TALER_MHD_reply_with_error (connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_EXCHANGE_GENERIC_BAD_CONFIGURATION,
- "no keys");
+ hc,
+ ec,
+ NULL);
}
- /* Obtain information about the coin's denomination! */
- {
- struct TEH_DenominationKey *dk;
- unsigned int hc;
- enum TALER_ErrorCode ec;
-
- dk = TEH_keys_denomination_by_hash (&denom_hash,
- &ec,
- &hc);
- if (NULL == dk)
- {
- /* DKI not found, but we do have a coin with this DK in our database;
- not good... */
- GNUNET_break (0);
- TEH_KS_release (key_state);
- return TALER_MHD_reply_with_error (connection,
- hc,
- ec,
- NULL);
- }
- if (GNUNET_TIME_absolute_get ().abs_value_us >=
- dk->meta.expire_deposit.abs_value_us)
- {
- /* This denomination is past the expiration time for deposits, and thus refunds */
- TEH_KS_release (key_state);
- return TALER_MHD_reply_with_error (
- connection,
- MHD_HTTP_GONE,
- TALER_EC_EXCHANGE_GENERIC_DENOMINATION_EXPIRED,
- NULL);
- }
- refund->details.refund_fee = dk->meta.fee_refund;
+ if (GNUNET_TIME_absolute_get ().abs_value_us >=
+ dk->meta.expire_deposit.abs_value_us)
+ {
+ /* This denomination is past the expiration time for deposits, and thus refunds */
+ return TALER_MHD_reply_with_error (
+ connection,
+ MHD_HTTP_GONE,
+ TALER_EC_EXCHANGE_GENERIC_DENOMINATION_EXPIRED,
+ NULL);
}
- TEH_KS_release (key_state);
+ refund->details.refund_fee = dk->meta.fee_refund;
}
/* Finally run the actual transaction logic */