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

Function gossmap_node_get_announce

common/gossmap.c:1631–1647  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1629
1630/* Get the announcement msg (if any) for this node. */
1631u8 *gossmap_node_get_announce(const tal_t *ctx,
1632 const struct gossmap *map,
1633 const struct gossmap_node *n)
1634{
1635 u16 len;
1636 u8 *msg;
1637
1638 if (n->nann_off == 0)
1639 return NULL;
1640
1641 len = map_be16(map, n->nann_off - sizeof(struct gossip_hdr)
1642 + offsetof(struct gossip_hdr, len));
1643 msg = tal_arr(ctx, u8, len);
1644
1645 map_copy(map, n->nann_off, msg, len);
1646 return msg;
1647}
1648
1649/* BOLT #7:
1650 * 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