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