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

Function node_announcement

common/gossmap.c:650–668  ·  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

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