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

Function gossmap_chan_get_announce

common/gossmap.c:1613–1628  ·  view source on GitHub ↗

Get the announcement msg which created this chan */

Source from the content-addressed store, hash-verified

1611
1612/* Get the announcement msg which created this chan */
1613u8 *gossmap_chan_get_announce(const tal_t *ctx,
1614 const struct gossmap *map,
1615 const struct gossmap_chan *c)
1616{
1617 u16 len;
1618 u8 *msg;
1619
1620 if (gossmap_chan_is_localmod(map, c))
1621 return NULL;
1622 len = map_be16(map, c->cann_off - sizeof(struct gossip_hdr)
1623 + offsetof(struct gossip_hdr, len));
1624
1625 msg = tal_arr(ctx, u8, len);
1626 map_copy(map, c->cann_off, msg, len);
1627 return msg;
1628}
1629
1630/* Get the announcement msg (if any) for this node. */
1631u8 *gossmap_node_get_announce(const tal_t *ctx,

Callers 4

spam_new_peerFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 3

gossmap_chan_is_localmodFunction · 0.85
map_be16Function · 0.85
map_copyFunction · 0.85

Tested by 2

mainFunction · 0.68
mainFunction · 0.68