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

Function gossmap_node_get_announce

common/gossmap.c:1637–1653  ·  view source on GitHub ↗

Get the announcement msg (if any) for this node. */

Source from the content-addressed store, hash-verified

1635
1636/* Get the announcement msg (if any) for this node. */
1637u8 *gossmap_node_get_announce(const tal_t *ctx,
1638 const struct gossmap *map,
1639 const struct gossmap_node *n)
1640{
1641 u16 len;
1642 u8 *msg;
1643
1644 if (n->nann_off == 0)
1645 return NULL;
1646
1647 len = map_be16(map, n->nann_off - sizeof(struct gossip_hdr)
1648 + offsetof(struct gossip_hdr, len));
1649 msg = tal_arr(ctx, u8, len);
1650
1651 map_copy(map, n->nann_off, msg, len);
1652 return msg;
1653}
1654
1655/* BOLT #7:
1656 * 1. type: 256 (`channel_announcement`)

Callers 10

spam_new_peerFunction · 0.85
append_gossmap_addressesFunction · 0.85
remove_channelFunction · 0.85
get_random_nodeFunction · 0.85
mainFunction · 0.85
json_add_nodeFunction · 0.85
we_want_blinded_pathFunction · 0.85
get_aliasFunction · 0.85

Calls 2

map_be16Function · 0.85
map_copyFunction · 0.85

Tested by 1

mainFunction · 0.68