Get the announcement msg which created this chan */
| 1611 | |
| 1612 | /* Get the announcement msg which created this chan */ |
| 1613 | u8 *gossmap_chan_get_announce(const tal_t *ctx, |
| 1614 | const struct gossmap *map, |
| 1615 | const struct gossmap_chan *c) |
| 1616 | { |
| 1617 | u16 len; |
| 1618 | u8 *msg; |
| 1619 | |
| 1620 | if (gossmap_chan_is_localmod(map, c)) |
| 1621 | return NULL; |
| 1622 | len = map_be16(map, c->cann_off - sizeof(struct gossip_hdr) |
| 1623 | + offsetof(struct gossip_hdr, len)); |
| 1624 | |
| 1625 | msg = tal_arr(ctx, u8, len); |
| 1626 | map_copy(map, c->cann_off, msg, len); |
| 1627 | return msg; |
| 1628 | } |
| 1629 | |
| 1630 | /* Get the announcement msg (if any) for this node. */ |
| 1631 | u8 *gossmap_node_get_announce(const tal_t *ctx, |