commit 8e0c026dd1e05fbe3cdb7759eca1b9fadc9eac6f
parent 7e95a2a4021692f3e094c6f1997f1e543ce4a542
Author: Christian Grothoff <christian@grothoff.org>
Date: Thu, 3 Jul 2025 17:46:28 +0200
make common_amounts optional, as it was just introduced and we may still interact with legacy exchanges
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/json/json_helper.c b/src/json/json_helper.c
@@ -168,7 +168,7 @@ parse_cspec (void *cls,
uint32_t fnd;
uint32_t ftzd;
const json_t *map;
- const json_t *ca;
+ const json_t *ca = NULL;
struct GNUNET_JSON_Specification gspec[] = {
GNUNET_JSON_spec_string ("name",
&name),
@@ -180,8 +180,10 @@ parse_cspec (void *cls,
&ftzd),
GNUNET_JSON_spec_object_const ("alt_unit_names",
&map),
- GNUNET_JSON_spec_array_const ("common_amounts",
- &ca),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_array_const ("common_amounts",
+ &ca),
+ NULL),
GNUNET_JSON_spec_end ()
};
const char *emsg;
@@ -232,6 +234,7 @@ parse_cspec (void *cls,
}
r_cspec->name = GNUNET_strdup (name);
r_cspec->map_alt_unit_names = json_incref ((json_t *) map);
+ if (NULL != ca)
{
size_t i;
json_t *v;