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

Function wire_sync_write

wire/wire_sync.c:9–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include <wire/wire_sync.h>
8
9bool wire_sync_write(int fd, const void *msg TAKES)
10{
11 wire_len_t hdr = cpu_to_wirelen(tal_bytelen(msg));
12 bool ret;
13
14 assert(tal_bytelen(msg) < WIRE_LEN_LIMIT);
15 ret = write_all(fd, &hdr, sizeof(hdr))
16 && write_all(fd, msg, tal_count(msg));
17
18 tal_free_if_taken(msg);
19 return ret;
20}
21
22u8 *wire_sync_read(const tal_t *ctx, int fd)
23{

Callers 7

load_hsmFunction · 0.50
hsm_initFunction · 0.50
hsm_sync_reqFunction · 0.50
json_makesecretFunction · 0.50
handle_funding_depthFunction · 0.50
child_logvFunction · 0.50

Calls 3

tal_bytelenFunction · 0.85
tal_free_if_takenFunction · 0.85
write_allFunction · 0.50

Tested by

no test coverage detected