aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-08-24 10:16:25 +0200
committerChristian Grothoff <christian@grothoff.org>2022-08-24 10:16:25 +0200
commitd37d9d9ded72e63149efc96b6107d0edee3683a9 (patch)
tree4b7922214f967566ff23671d002b7b38b60c989e
parentbc107b59587d0f98d278c958ba775e215312b618 (diff)
-handle case of GET purse status prior to merge
-rw-r--r--src/exchange/taler-exchange-httpd_purses_get.c5
-rw-r--r--src/lib/exchange_api_purses_get.c7
2 files changed, 8 insertions, 4 deletions
diff --git a/src/exchange/taler-exchange-httpd_purses_get.c b/src/exchange/taler-exchange-httpd_purses_get.c
index e56cfe485..c17f4b07c 100644
--- a/src/exchange/taler-exchange-httpd_purses_get.c
+++ b/src/exchange/taler-exchange-httpd_purses_get.c
@@ -428,8 +428,9 @@ TEH_handler_purses_get (struct TEH_RequestContext *rc,
&exchange_sig),
GNUNET_JSON_pack_data_auto ("exchange_pub",
&exchange_pub),
- GNUNET_JSON_pack_timestamp ("merge_timestamp",
- gc->merge_timestamp),
+ GNUNET_JSON_pack_allow_null (
+ GNUNET_JSON_pack_timestamp ("merge_timestamp",
+ gc->merge_timestamp)),
GNUNET_JSON_pack_timestamp ("deposit_timestamp",
dt)
);
diff --git a/src/lib/exchange_api_purses_get.c b/src/lib/exchange_api_purses_get.c
index 021954c2d..16b0e223e 100644
--- a/src/lib/exchange_api_purses_get.c
+++ b/src/lib/exchange_api_purses_get.c
@@ -94,11 +94,14 @@ handle_purse_get_finished (void *cls,
break;
case MHD_HTTP_OK:
{
+ bool no_merge = false;
struct TALER_ExchangePublicKeyP exchange_pub;
struct TALER_ExchangeSignatureP exchange_sig;
struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_timestamp ("merge_timestamp",
- &dr.details.success.merge_timestamp),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_timestamp ("merge_timestamp",
+ &dr.details.success.merge_timestamp),
+ &no_merge),
GNUNET_JSON_spec_timestamp ("deposit_timestamp",
&dr.details.success.deposit_timestamp),
TALER_JSON_spec_amount_any ("balance",