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

Function io_write_wire_

wire/wire_io.c:142–160  ·  view source on GitHub ↗

Write message from data (tal_count(data) gives length). */

Source from the content-addressed store, hash-verified

140
141/* Write message from data (tal_count(data) gives length). */
142struct io_plan *io_write_wire_(struct io_conn *conn,
143 const u8 *data,
144 struct io_plan *(*next)(struct io_conn *, void *),
145 void *next_arg)
146{
147 struct io_plan_arg *arg = io_plan_arg(conn, IO_OUT);
148
149 if (tal_bytelen(data) >= INSIDE_HEADER_BIT) {
150 errno = E2BIG;
151 return io_close(conn);
152 }
153
154 arg->u1.const_vp = tal_dup_talarr(conn, u8,
155 memcheck(data, tal_bytelen(data)));
156
157 /* We use u2 to store the length we've written. */
158 arg->u2.s = INSIDE_HEADER_BIT;
159 return io_set_plan(conn, IO_OUT, do_write_wire, next, next_arg);
160}

Callers 1

check_client_writeFunction · 0.50

Calls 4

tal_bytelenFunction · 0.85
io_closeFunction · 0.85
io_set_planFunction · 0.85
io_plan_argClass · 0.70

Tested by 1

check_client_writeFunction · 0.40