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

Function gossmap_chan_get_announce

common/gossmap.c:1124–1142  ·  view source on GitHub ↗

Get the announcement msg which created this chan */

Source from the content-addressed store, hash-verified

1122
1123/* Get the announcement msg which created this chan */
1124u8 *gossmap_chan_get_announce(const tal_t *ctx,
1125 const struct gossmap *map,
1126 const struct gossmap_chan *c)
1127{
1128 u32 len;
1129 u8 *msg;
1130 u32 pre_off;
1131
1132 /* We need to go back to struct gossip_hdr to get len */
1133 if (c->private)
1134 pre_off = 2 + 8 + 2 + sizeof(struct gossip_hdr);
1135 else
1136 pre_off = sizeof(struct gossip_hdr);
1137 len = (map_be32(map, c->cann_off - pre_off) & GOSSIP_STORE_LEN_MASK);
1138
1139 msg = tal_arr(ctx, u8, len);
1140 map_copy(map, c->cann_off, msg, len);
1141 return msg;
1142}
1143
1144/* Get the announcement msg (if any) for this node. */
1145u8 *gossmap_node_get_announce(const tal_t *ctx,

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 2

map_be32Function · 0.85
map_copyFunction · 0.85

Tested by 2

mainFunction · 0.68
mainFunction · 0.68