Browse Source

fix: handle empty addrs case

pull/1683/head
Steven Allen 6 years ago
parent
commit
f914c757b1
  1. 3
      core/peer/addrinfo.go

3
core/peer/addrinfo.go

@ -47,6 +47,9 @@ func AddrInfoToP2pAddrs(pi *AddrInfo) ([]ma.Multiaddr, error) {
if err != nil {
return nil, err
}
if len(pi.Addrs) == 0 {
return []ma.Multiaddr{p2ppart}, nil
}
for _, addr := range pi.Addrs {
addrs = append(addrs, addr.Encapsulate(p2ppart))
}

Loading…
Cancel
Save