common/json_stream: make json_add_jsonstr take a length.

This is useful when have have a jsmntok_t.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-07-16 14:28:58 +09:30
parent f65d3bb1fc
commit d0a55a62b3
6 changed files with 23 additions and 15 deletions

View File

@@ -346,7 +346,9 @@ openchannel_finished(struct multifundchannel_command *mfc)
json_add_node_id(out, "id", &dest->id);
json_add_string(out, "method", "openchannel_signed");
if (dest->error_data)
json_add_jsonstr(out, "data", dest->error_data);
json_add_jsonstr(out, "data",
dest->error_data,
strlen(dest->error_data));
json_object_end(out);
return mfc_finished(mfc, out);