Get the announcement msg (if any) for this node. */
| 1635 | |
| 1636 | /* Get the announcement msg (if any) for this node. */ |
| 1637 | u8 *gossmap_node_get_announce(const tal_t *ctx, |
| 1638 | const struct gossmap *map, |
| 1639 | const struct gossmap_node *n) |
| 1640 | { |
| 1641 | u16 len; |
| 1642 | u8 *msg; |
| 1643 | |
| 1644 | if (n->nann_off == 0) |
| 1645 | return NULL; |
| 1646 | |
| 1647 | len = map_be16(map, n->nann_off - sizeof(struct gossip_hdr) |
| 1648 | + offsetof(struct gossip_hdr, len)); |
| 1649 | msg = tal_arr(ctx, u8, len); |
| 1650 | |
| 1651 | map_copy(map, n->nann_off, msg, len); |
| 1652 | return msg; |
| 1653 | } |
| 1654 | |
| 1655 | /* BOLT #7: |
| 1656 | * 1. type: 256 (`channel_announcement`) |