mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-03 22:34:21 +01:00
We use the high bit of the length field: this way we can still check that the checksums are valid on deleted fields. Once this is done, serially reading the gossip_store file will result in a complete, ordered, minimal gossip broadcast. Also, the horrible corner case where we might try to delete things from the store during load time is completely gone: we only load non-deleted things. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
25 lines
603 B
C
25 lines
603 B
C
#ifndef LIGHTNING_COMMON_GOSSIP_STORE_H
|
|
#define LIGHTNING_COMMON_GOSSIP_STORE_H
|
|
#include "config.h"
|
|
#include <ccan/short_types/short_types.h>
|
|
#include <ccan/tal/tal.h>
|
|
|
|
/**
|
|
* gossip_store -- On-disk storage related information
|
|
*/
|
|
#define GOSSIP_STORE_VERSION 5
|
|
|
|
/**
|
|
* Bit of length we use to mark a deleted record.
|
|
*/
|
|
#define GOSSIP_STORE_LEN_DELETED_BIT 0x80000000U
|
|
|
|
/**
|
|
* Direct store accessor: loads gossip msg from store.
|
|
*
|
|
* Doesn't return; status_failed() on error.
|
|
*/
|
|
u8 *gossip_store_read(const tal_t *ctx, int gossip_store_fd, u64 offset);
|
|
|
|
#endif /* LIGHTNING_COMMON_GOSSIP_STORE_H */
|