Get the announcement msg (if any) for this node. */
| 1143 | |
| 1144 | /* Get the announcement msg (if any) for this node. */ |
| 1145 | u8 *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`) |