summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-httpd.c6
-rw-r--r--src/exchange/taler-exchange-httpd_config.h2
-rw-r--r--src/exchange/taler-exchange-httpd_keys.c99
-rw-r--r--src/exchange/taler-exchange-httpd_keys.h12
-rw-r--r--src/exchange/taler-exchange-httpd_purses_get.c5
5 files changed, 6 insertions, 118 deletions
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
index 194ec6dae..acda91f5d 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -1482,12 +1482,6 @@ handle_mhd_request (void *cls,
.method = MHD_HTTP_METHOD_GET,
.handler.get = &TEH_keys_get_handler,
},
- /* Requests for wiring information */
- {
- .url = "wire",
- .method = MHD_HTTP_METHOD_GET,
- .handler.get = &TEH_handler_wire
- },
{
.url = "batch-deposit",
.method = MHD_HTTP_METHOD_POST,
diff --git a/src/exchange/taler-exchange-httpd_config.h b/src/exchange/taler-exchange-httpd_config.h
index 596765b27..ea4551721 100644
--- a/src/exchange/taler-exchange-httpd_config.h
+++ b/src/exchange/taler-exchange-httpd_config.h
@@ -41,7 +41,7 @@
*
* Returned via both /config and /keys endpoints.
*/
-#define EXCHANGE_PROTOCOL_VERSION "16:0:1"
+#define EXCHANGE_PROTOCOL_VERSION "17:0:0"
/**
diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c
index a6a1340da..a4e7ace83 100644
--- a/src/exchange/taler-exchange-httpd_keys.c
+++ b/src/exchange/taler-exchange-httpd_keys.c
@@ -1054,60 +1054,6 @@ get_wire_state (void)
}
-MHD_RESULT
-TEH_handler_wire (struct TEH_RequestContext *rc,
- const char *const args[])
-{
- struct WireStateHandle *wsh;
-
- (void) args;
- wsh = get_wire_state ();
- if (NULL == wsh)
- return TALER_MHD_reply_with_error (rc->connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_EXCHANGE_GENERIC_BAD_CONFIGURATION,
- NULL);
- {
- const char *etag;
-
- etag = MHD_lookup_connection_value (rc->connection,
- MHD_HEADER_KIND,
- MHD_HTTP_HEADER_IF_NONE_MATCH);
- if ( (NULL != etag) &&
- (MHD_HTTP_OK == wsh->http_status) &&
- (NULL != wsh->etag) &&
- (0 == strcmp (etag,
- wsh->etag)) )
- {
- MHD_RESULT ret;
- struct MHD_Response *resp;
-
- resp = MHD_create_response_from_buffer (0,
- NULL,
- MHD_RESPMEM_PERSISTENT);
- TALER_MHD_add_global_headers (resp);
- GNUNET_break (MHD_YES ==
- MHD_add_response_header (resp,
- MHD_HTTP_HEADER_EXPIRES,
- wsh->dat));
- GNUNET_break (MHD_YES ==
- MHD_add_response_header (resp,
- MHD_HTTP_HEADER_ETAG,
- wsh->etag));
- ret = MHD_queue_response (rc->connection,
- MHD_HTTP_NOT_MODIFIED,
- resp);
- GNUNET_break (MHD_YES == ret);
- MHD_destroy_response (resp);
- return ret;
- }
- }
- return MHD_queue_response (rc->connection,
- wsh->http_status,
- wsh->wire_reply);
-}
-
-
const struct TALER_WireFeeSet *
TEH_wire_fees_by_time (
struct GNUNET_TIME_Timestamp ts,
@@ -2479,7 +2425,6 @@ create_krd (struct TEH_KeyStateHandle *ksh,
struct GNUNET_TIME_Timestamp last_cherry_pick_date,
json_t *signkeys,
json_t *recoup,
- json_t *denoms,
json_t *grouped_denominations,
const struct GNUNET_HashCode *h_grouped)
{
@@ -2501,7 +2446,6 @@ create_krd (struct TEH_KeyStateHandle *ksh,
last_cherry_pick_date.abs_time));
GNUNET_assert (NULL != signkeys);
GNUNET_assert (NULL != recoup);
- GNUNET_assert (NULL != denoms);
GNUNET_assert (NULL != grouped_denominations);
GNUNET_assert (NULL != h_grouped);
GNUNET_assert (NULL != ksh->auditors);
@@ -2602,8 +2546,6 @@ create_krd (struct TEH_KeyStateHandle *ksh,
signkeys),
GNUNET_JSON_pack_array_incref ("recoup",
recoup),
- GNUNET_JSON_pack_array_incref ("denoms",
- denoms),
GNUNET_JSON_pack_array_incref ("wads",
json_object_get (wsh->json_reply,
"wads")),
@@ -2813,7 +2755,6 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
enum GNUNET_GenericReturnValue ret = GNUNET_SYSERR;
json_t *recoup;
struct SignKeyCtx sctx;
- json_t *denoms = NULL;
json_t *grouped_denominations = NULL;
struct GNUNET_TIME_Timestamp last_cherry_pick_date;
struct GNUNET_CONTAINER_Heap *heap;
@@ -2846,8 +2787,6 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
sctx.min_sk_frequency);
}
- denoms = json_array ();
- GNUNET_assert (NULL != denoms);
hash_context = GNUNET_CRYPTO_hash_context_start ();
grouped_denominations = json_array ();
@@ -2905,7 +2844,6 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
last_cherry_pick_date,
sctx.signkeys,
recoup,
- denoms,
grouped_denominations,
&grouped_hash_xor))
{
@@ -2922,41 +2860,6 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
}
last_cherry_pick_date = dk->meta.start;
-
- {
- json_t *denom;
-
- denom =
- GNUNET_JSON_PACK (
- GNUNET_JSON_pack_data_auto ("master_sig",
- &dk->master_sig),
- GNUNET_JSON_pack_timestamp ("stamp_start",
- dk->meta.start),
- GNUNET_JSON_pack_timestamp ("stamp_expire_withdraw",
- dk->meta.expire_withdraw),
- GNUNET_JSON_pack_timestamp ("stamp_expire_deposit",
- dk->meta.expire_deposit),
- GNUNET_JSON_pack_timestamp ("stamp_expire_legal",
- dk->meta.expire_legal),
- TALER_JSON_pack_denom_pub ("denom_pub",
- &dk->denom_pub),
- TALER_JSON_pack_amount ("value",
- &dk->meta.value),
- TALER_JSON_PACK_DENOM_FEES ("fee",
- &dk->meta.fees));
-
- GNUNET_CRYPTO_hash_context_read (hash_context,
- &dk->h_denom_pub,
- sizeof (struct GNUNET_HashCode));
-
- GNUNET_assert (
- 0 ==
- json_array_append_new (
- denoms,
- denom));
-
- }
-
/*
* Group the denominations by {cipher, value, fees, age_mask}.
*
@@ -3166,7 +3069,6 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
last_cherry_pick_date,
sctx.signkeys,
recoup,
- denoms,
grouped_denominations,
&grouped_hash_xor))
{
@@ -3205,7 +3107,6 @@ CLEANUP:
json_decref (grouped_denominations);
json_decref (sctx.signkeys);
json_decref (recoup);
- json_decref (denoms);
return ret;
}
diff --git a/src/exchange/taler-exchange-httpd_keys.h b/src/exchange/taler-exchange-httpd_keys.h
index f30eeb626..61096de93 100644
--- a/src/exchange/taler-exchange-httpd_keys.h
+++ b/src/exchange/taler-exchange-httpd_keys.h
@@ -198,18 +198,6 @@ TEH_wire_update_state (void);
/**
- * Handle a "/wire" request.
- *
- * @param rc request context
- * @param args array of additional options (must be empty for this function)
- * @return MHD result code
- */
-MHD_RESULT
-TEH_handler_wire (struct TEH_RequestContext *rc,
- const char *const args[]);
-
-
-/**
* Return the current key state for this thread. Possibly re-builds the key
* state if we have reason to believe that something changed.
*
diff --git a/src/exchange/taler-exchange-httpd_purses_get.c b/src/exchange/taler-exchange-httpd_purses_get.c
index 5e4e0619f..0701fc452 100644
--- a/src/exchange/taler-exchange-httpd_purses_get.c
+++ b/src/exchange/taler-exchange-httpd_purses_get.c
@@ -401,6 +401,10 @@ TEH_handler_purses_get (struct TEH_RequestContext *rc,
ec,
NULL);
else
+ {
+ /* Make sure merge_timestamp is omitted if not yet merged */
+ if (GNUNET_TIME_absolute_is_never (gc->merge_timestamp.abs_time))
+ gc->merge_timestamp = GNUNET_TIME_UNIT_ZERO_TS;
res = TALER_MHD_REPLY_JSON_PACK (
rc->connection,
MHD_HTTP_OK,
@@ -419,6 +423,7 @@ TEH_handler_purses_get (struct TEH_RequestContext *rc,
GNUNET_JSON_pack_timestamp ("deposit_timestamp",
dt))
);
+ }
}
return res;
}