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

Function wire_sync_read

wire/wire_sync.c:22–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22u8 *wire_sync_read(const tal_t *ctx, int fd)
23{
24 wire_len_t len;
25 u8 *msg;
26
27 if (!read_all(fd, &len, sizeof(len)))
28 return NULL;
29 if (wirelen_to_cpu(len) >= WIRE_LEN_LIMIT) {
30 errno = E2BIG;
31 return NULL;
32 }
33 msg = tal_arr(ctx, u8, wirelen_to_cpu(len));
34 if (!read_all(fd, msg, wirelen_to_cpu(len)))
35 return tal_free(msg);
36 return msg;
37}

Callers 14

send_offerFunction · 0.50
tell_master_their_offerFunction · 0.50
mainFunction · 0.50
hsm_reqFunction · 0.50
master_wait_sync_replyFunction · 0.50
update_hsmd_with_spliceFunction · 0.50
init_channelFunction · 0.50
mainFunction · 0.50
hsm_initFunction · 0.50
hsm_sync_reqFunction · 0.50
json_makesecretFunction · 0.50
handle_funding_depthFunction · 0.50

Calls 2

read_allFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected