lightningd: suppress IO_OUT logging for getlog command

Before this, the response of `getlog io` blew up quickly
when called multiple times.
This commit is contained in:
Simon Vrouwe
2019-05-23 13:09:17 +03:00
committed by Rusty Russell
parent 8feb05aef4
commit db57d9c5d2
5 changed files with 24 additions and 0 deletions

View File

@@ -100,6 +100,13 @@ void json_stream_close(struct json_stream *js, struct command *writer)
js->writer = NULL;
}
void json_stream_log_suppress(struct json_stream *js, const char *cmd_name)
{
/* Really shouldn't be used for anything else */
assert(streq(cmd_name, "getlog"));
js->log = NULL;
}
/* FIXME: This, or something prettier (io_replan?) belong in ccan/io! */
static void adjust_io_write(struct io_conn *conn, ptrdiff_t delta)
{