Commit 9f837210 authored by Will Scott's avatar Will Scott Committed by Adin Schmahmann

static nat shouldn't call host.Addrs()

avoid potential call loop
parent 411d9e30
......@@ -443,9 +443,5 @@ func (s *StaticAutoNAT) PublicAddr() (ma.Multiaddr, error) {
if s.reachability != network.ReachabilityPublic {
return nil, errors.New("NAT status is not public")
}
addrs := s.host.Addrs()
if len(addrs) > 0 {
return s.host.Addrs()[0], nil
}
return nil, errors.New("No available address")
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment