common/gossip_store: clean up header.

It's actually two separate u16 fields, so actually treat it as
such!

Cleans up zombie handling code a bit too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-01-30 16:54:08 +10:30
committed by Alex Myers
parent 83c690fe5f
commit 0274d88bad
8 changed files with 106 additions and 146 deletions

View File

@@ -244,7 +244,8 @@ static void write_to_store(int store_fd, const u8 *msg)
{
struct gossip_hdr hdr;
hdr.len = cpu_to_be32(tal_count(msg));
hdr.flags = cpu_to_be16(0);
hdr.len = cpu_to_be16(tal_count(msg));
/* We don't actually check these! */
hdr.crc = 0;
hdr.timestamp = 0;