mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
libplugin: don't turn non-string JSON ids into strings.
When called with `"id": 1` we replied with `"id": "1"`. lightningd doesn't actually care, but it's weird. Copy the entire token: this way we don't have to special case anything. Also, remove the doubled test in json_add_jsonstr. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -66,7 +66,7 @@ const jsmntok_t *json_get_member(const char *buffer, const jsmntok_t tok[],
|
||||
/* Get index'th array member. */
|
||||
const jsmntok_t *json_get_arr(const jsmntok_t tok[], size_t index);
|
||||
|
||||
/* Helper to get "id" field from object. */
|
||||
/* Helper to get "id" field from object (including any quotes!). */
|
||||
const char *json_get_id(const tal_t *ctx,
|
||||
const char *buffer, const jsmntok_t *obj);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user