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

Function write_to_store

common/test/run-route-specific.c:57–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55/* AUTOGENERATED MOCKS END */
56
57static void write_to_store(int store_fd, const u8 *msg)
58{
59 struct gossip_hdr hdr;
60
61 hdr.flags = cpu_to_be16(GOSSIP_STORE_COMPLETED_BIT);
62 hdr.len = cpu_to_be16(tal_count(msg));
63 hdr.timestamp = 0;
64 hdr.crc = cpu_to_be32(crc32c(be32_to_cpu(hdr.timestamp), msg, tal_count(msg)));
65 assert(write(store_fd, &hdr, sizeof(hdr)) == sizeof(hdr));
66 assert(write(store_fd, msg, tal_count(msg)) == tal_count(msg));
67}
68
69static void update_connection(int store_fd,
70 const struct node_id *from,

Callers 2

update_connectionFunction · 0.70
add_connectionFunction · 0.70

Calls 4

cpu_to_be16Function · 0.85
cpu_to_be32Function · 0.85
crc32cFunction · 0.85
be32_to_cpuFunction · 0.85

Tested by

no test coverage detected