| 44 | } |
| 45 | |
| 46 | static 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 | |
| 59 | static u32 get_update_timestamp(const u8 *msg, struct short_channel_id *scid) |
| 60 | { |
no test coverage detected