gossipd: keep index of node and channel announcements.

This lets detect if a node announce preceeds a channel announce once we
delete the node announcement.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-06-08 16:01:49 +09:30
committed by Christian Decker
parent 294c76e749
commit a38c619486
8 changed files with 32 additions and 23 deletions

View File

@@ -52,6 +52,8 @@ struct chan {
/* NULL if not announced yet (ie. not public). */
const u8 *channel_announce;
/* Index in broadcast map, if public (otherwise 0) */
u64 channel_announcement_index;
u64 satoshis;
};
@@ -101,7 +103,8 @@ struct node {
/* Cached `node_announcement` we might forward to new peers (or NULL). */
const u8 *node_announcement;
bool node_announcement_public;
/* If public, this is non-zero. */
u64 node_announcement_index;
};
const secp256k1_pubkey *node_map_keyof_node(const struct node *n);