MCPcopy Create free account
hub / github.com/ElementsProject/lightning / node_announcement

Function node_announcement

common/gossmap.c:653–671  ·  view source on GitHub ↗

BOLT #7: * 1. type: 257 (`node_announcement`) * 2. data: * * [`signature`:`signature`] * * [`u16`:`flen`] * * [`flen*byte`:`features`] * * [`u32`:`timestamp`] * * [`point`:`node_id`] * * [`3*byte`:`rgb_color`] * * [`32*byte`:`alias`] * * [`u16`:`addrlen`] * * [`addrlen*byte`:`addresses`] */

Source from the content-addressed store, hash-verified

651 * * [`addrlen*byte`:`addresses`]
652 */
653static void node_announcement(struct gossmap *map, u64 nann_off)
654{
655 const u64 feature_len_off = 2 + 64;
656 size_t feature_len;
657 struct gossmap_node *n;
658 struct node_id id;
659
660 feature_len = map_be16(map, nann_off + feature_len_off);
661 map_nodeid(map, nann_off + feature_len_off + 2 + feature_len + 4, &id);
662 if ((n = gossmap_find_node(map, &id))) {
663 /* Did this replace old announcement? If so, that's dead. */
664 if (gossmap_node_announced(n)) {
665 map->num_live--;
666 map->num_dead++;
667 }
668 n->nann_off = nann_off;
669 }
670 map->num_live++;
671}
672
673static bool report_dying_cb(struct gossmap *map,
674 u64 dying_off,

Callers 1

map_catchupFunction · 0.70

Calls 4

map_be16Function · 0.85
map_nodeidFunction · 0.85
gossmap_find_nodeFunction · 0.85
gossmap_node_announcedFunction · 0.85

Tested by

no test coverage detected