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

Function writerec

gossipd/compactd.c:41–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41static void writerec(int fd, const void *msg)
42{
43 struct gossip_hdr ghdr;
44
45 ghdr.flags = cpu_to_be16(GOSSIP_STORE_COMPLETED_BIT);
46 ghdr.len = cpu_to_be16(tal_bytelen(msg));
47 ghdr.timestamp = 0;
48 ghdr.crc = cpu_to_be32(crc32c(be32_to_cpu(ghdr.timestamp),
49 msg, tal_bytelen(msg)));
50 writex(fd, &ghdr, sizeof(ghdr));
51 writex(fd, msg, tal_bytelen(msg));
52}
53
54static u64 copy_records(int oldfd, int newfd, u64 old_off, u64 limit,
55 bool keep_delete_chan)

Callers 1

mainFunction · 0.85

Calls 6

cpu_to_be16Function · 0.85
tal_bytelenFunction · 0.85
cpu_to_be32Function · 0.85
crc32cFunction · 0.85
be32_to_cpuFunction · 0.85
writexFunction · 0.85

Tested by

no test coverage detected