gossipd: handle a "push" marker into the gossip_store.

This tells clients to ignore any timestamp_filter and always
send this message when it sees it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-11-04 11:07:02 +10:30
committed by Christian Decker
parent 2d8e93687d
commit bb370e66a8
4 changed files with 29 additions and 10 deletions

View File

@@ -55,11 +55,12 @@ int main(int argc, char *argv[])
struct amount_sat sat;
u32 msglen = be32_to_cpu(hdr.len);
u8 *msg, *inner;
bool deleted;
bool deleted, push;
deleted = (msglen & GOSSIP_STORE_LEN_DELETED_BIT);
push = (msglen & GOSSIP_STORE_LEN_PUSH_BIT);
msglen &= ~GOSSIP_STORE_LEN_DELETED_BIT;
msglen &= GOSSIP_STORE_LEN_MASK;
msg = tal_arr(NULL, u8, msglen);
if (read(fd, msg, msglen) != msglen)
errx(1, "%zu: Truncated file?", off);
@@ -68,7 +69,9 @@ int main(int argc, char *argv[])
!= crc32c(be32_to_cpu(hdr.timestamp), msg, msglen))
warnx("Checksum verification failed");
printf("%zu: %s", off, deleted ? "DELETED " : "");
printf("%zu: %s%s", off,
deleted ? "DELETED " : "",
push ? "PUSH " : "");
if (deleted && !print_deleted) {
printf("\n");
goto end;