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

Function write_outmsg

devtools/create-gossipstore.c:46–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46static void write_outmsg(int outfd, const u8 *outmsg, u32 timestamp)
47{
48 struct gossip_hdr hdr;
49
50 hdr.len = cpu_to_be32(tal_count(outmsg));
51 hdr.crc = cpu_to_be32(crc32c(timestamp, outmsg, tal_count(outmsg)));
52 hdr.timestamp = cpu_to_be32(timestamp);
53
54 if (!write_all(outfd, &hdr, sizeof(hdr))
55 || !write_all(outfd, outmsg, tal_count(outmsg)))
56 err(1, "Writing output");
57}
58
59static u32 get_update_timestamp(const u8 *msg, struct short_channel_id *scid)
60{

Callers 1

mainFunction · 0.85

Calls 4

cpu_to_be32Function · 0.85
crc32cFunction · 0.85
errFunction · 0.85
write_allFunction · 0.50

Tested by

no test coverage detected