openingd: fix compile error caused by merge.

Compile broke because we were using low-level JSON primitives here
(which, incidentally, would produce bad JSON now, since we can't just
put a raw string inside an object!).

Use json_add_string, which also has the benefit of escaping JSON
for us.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2019-06-12 12:32:45 +09:30
parent c0475d0d9d
commit 4c118bcdba

View File

@ -690,9 +690,7 @@ static void opening_funder_failed(struct subd *openingd, const u8 *msg,
was_pending(command_fail(uc->fc->cmd, LIGHTNINGD, "%s", desc));
else {
response = json_stream_success(uc->fc->cmd);
json_stream_append(response, "\"");
json_stream_append(response, desc);
json_stream_append(response, "\"");
json_add_string(response, "cancelled", desc);
was_pending(command_success(uc->fc->cmd, response));
}