MCPcopy Create free account
hub / github.com/ElementsProject/lightning / jcon_new_json_stream

Function jcon_new_json_stream

lightningd/jsonrpc.c:125–135  ·  view source on GitHub ↗

The command itself usually owns the stream, because jcon may get closed. * The command transfers ownership once it's done though. */

Source from the content-addressed store, hash-verified

123/* The command itself usually owns the stream, because jcon may get closed.
124 * The command transfers ownership once it's done though. */
125static struct json_stream *jcon_new_json_stream(const tal_t *ctx,
126 struct json_connection *jcon,
127 struct command *writer)
128{
129 struct json_stream *js = new_json_stream(ctx, writer, jcon->log);
130
131 /* Wake writer to start streaming, in case it's not already. */
132 io_wake(jcon);
133 list_add_tail(&jcon->jsouts, &js->list);
134 return js;
135}
136
137/* jcon and cmd have separate lifetimes: we detach them on either destruction */
138static void destroy_jcon(struct json_connection *jcon)

Callers 2

json_command_malformedFunction · 0.85
json_stream_raw_for_cmdFunction · 0.85

Calls 2

new_json_streamFunction · 0.85
io_wakeFunction · 0.85

Tested by

no test coverage detected