1 #ifndef LIGHTNING_GOSSIPD_GOSSIP_GENERATION_H 2 #define LIGHTNING_GOSSIPD_GOSSIP_GENERATION_H 3 #include "config.h" 4 #include <ccan/short_types/short_types.h> 5 #include <stdbool.h> 6 #include <stddef.h> 7 8 struct chan; 9 struct daemon; 10 struct half_chan; 11 struct local_chan; 12 struct gossip_store; 13 struct peer; 14 struct node; 15 16 /* Helper to get non-signature, non-timestamp parts of (valid!) channel_update */ 17 void get_cupdate_parts(const u8 *channel_update, 18 const u8 *parts[2], 19 size_t sizes[2]); 20 21 22 /* Is this channel_update different from prev (not sigs and timestamps)? 23 * is_halfchan_defined(hc) must be true! */ 24 bool cupdate_different(struct gossip_store *gs, 25 const struct half_chan *hc, 26 const u8 *cupdate); 27 28 /* Is this node_announcement different from prev (not sigs and timestamps)? 29 * node->bcast.index must be non-zero! */ 30 bool nannounce_different(struct gossip_store *gs, 31 const struct node *node, 32 const u8 *nannounce, 33 bool *only_missing_tlv); 34 35 /* Should we announce our own node? Called at strategic places. */ 36 void maybe_send_own_node_announce(struct daemon *daemon, bool startup); 37 38 /* This is a refresh of a local channel: sends an update if one is needed. */ 39 void refresh_local_channel(struct daemon *daemon, 40 struct local_chan *local_chan, 41 bool even_if_identical); 42 43 /* channeld asks us to update the local channel. */ 44 bool handle_local_channel_update(struct daemon *daemon, 45 const struct node_id *src, 46 const u8 *msg); 47 48 #endif /* LIGHTNING_GOSSIPD_GOSSIP_GENERATION_H */ 49