From ecce2522bf06a42c8f18e54a72ae485af40113b6 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 30 May 2019 22:25:37 -0700 Subject: [PATCH] fix: handle empty addrs case --- peer/addrinfo.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/peer/addrinfo.go b/peer/addrinfo.go index 5688878..cc9633b 100644 --- a/peer/addrinfo.go +++ b/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)) }