zebra_network::protocol::external::addr::canonical

Function canonical_ip_addr

source
pub(in protocol::external) fn canonical_ip_addr(
    v6_addr: &Ipv6Addr,
) -> IpAddr
Expand description

Transform a Zcash-deserialized Ipv6Addr into a canonical Zebra IpAddr.

Zcash uses IPv6-mapped IPv4 addresses in its addr (v1) network messages. Zebra converts those addresses to Ipv4Addrs, for maximum compatibility with systems that don’t understand IPv6.

Zebra also uses this canonical format for addresses from other sources.