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

Function gossmap_node_get_announce

common/gossmap.c:1145–1161  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1143
1144/* Get the announcement msg (if any) for this node. */
1145u8 *gossmap_node_get_announce(const tal_t *ctx,
1146 const struct gossmap *map,
1147 const struct gossmap_node *n)
1148{
1149 u32 len;
1150 u8 *msg;
1151
1152 if (n->nann_off == 0)
1153 return NULL;
1154
1155 len = (map_be32(map, n->nann_off - sizeof(struct gossip_hdr))
1156 & GOSSIP_STORE_LEN_MASK);
1157 msg = tal_arr(ctx, u8, len);
1158
1159 map_copy(map, n->nann_off, msg, len);
1160 return msg;
1161}
1162
1163/* BOLT #7:
1164 * 1. type: 256 (`channel_announcement`)

Callers 2

mainFunction · 0.85
json_add_nodeFunction · 0.85

Calls 2

map_be32Function · 0.85
map_copyFunction · 0.85

Tested by 1

mainFunction · 0.68