summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_management_wire_disable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange/taler-exchange-httpd_management_wire_disable.c')
-rw-r--r--src/exchange/taler-exchange-httpd_management_wire_disable.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/exchange/taler-exchange-httpd_management_wire_disable.c b/src/exchange/taler-exchange-httpd_management_wire_disable.c
index 17bd7273f..e0b8a3de8 100644
--- a/src/exchange/taler-exchange-httpd_management_wire_disable.c
+++ b/src/exchange/taler-exchange-httpd_management_wire_disable.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2020 Taler Systems SA
+ Copyright (C) 2020-2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software
@@ -28,7 +28,7 @@
#include "taler_mhd_lib.h"
#include "taler-exchange-httpd_management.h"
#include "taler-exchange-httpd_responses.h"
-#include "taler-exchange-httpd_wire.h"
+#include "taler-exchange-httpd_keys.h"
/**
@@ -50,7 +50,7 @@ struct DelWireContext
/**
* Timestamp for checking against replay attacks.
*/
- struct GNUNET_TIME_Absolute validity_end;
+ struct GNUNET_TIME_Timestamp validity_end;
};
@@ -75,7 +75,7 @@ del_wire (void *cls,
MHD_RESULT *mhd_ret)
{
struct DelWireContext *awc = cls;
- struct GNUNET_TIME_Absolute last_date;
+ struct GNUNET_TIME_Timestamp last_date;
enum GNUNET_DB_QueryStatus qs;
qs = TEH_plugin->lookup_wire_timestamp (TEH_plugin->cls,
@@ -92,7 +92,9 @@ del_wire (void *cls,
"lookup wire");
return qs;
}
- if (last_date.abs_value_us > awc->validity_end.abs_value_us)
+ if (GNUNET_TIME_timestamp_cmp (last_date,
+ >,
+ awc->validity_end))
{
*mhd_ret = TALER_MHD_reply_with_error (
connection,
@@ -101,7 +103,7 @@ del_wire (void *cls,
NULL);
return GNUNET_DB_STATUS_HARD_ERROR;
}
- if (0 == qs)
+ if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
{
*mhd_ret = TALER_MHD_reply_with_error (
connection,
@@ -112,7 +114,13 @@ del_wire (void *cls,
}
qs = TEH_plugin->update_wire (TEH_plugin->cls,
awc->payto_uri,
+ NULL,
+ NULL,
+ NULL,
awc->validity_end,
+ NULL,
+ NULL,
+ 0,
false);
if (qs < 0)
{
@@ -138,10 +146,10 @@ TEH_handler_management_post_wire_disable (
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("master_sig_del",
&awc.master_sig),
- GNUNET_JSON_spec_string ("payto_uri",
- &awc.payto_uri),
- TALER_JSON_spec_absolute_time ("validity_end",
- &awc.validity_end),
+ TALER_JSON_spec_payto_uri ("payto_uri",
+ &awc.payto_uri),
+ GNUNET_JSON_spec_timestamp ("validity_end",
+ &awc.validity_end),
GNUNET_JSON_spec_end ()
};
@@ -177,6 +185,7 @@ TEH_handler_management_post_wire_disable (
res = TEH_DB_run_transaction (connection,
"del wire",
+ TEH_MT_REQUEST_OTHER,
&ret,
&del_wire,
&awc);