mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-27 07:57:30 +08:00
Clear up naming around zero address
This commit is contained in:
@ -128,7 +128,7 @@ func (s *Swarm) Dial(peer peer.Peer) (conn.Conn, error) {
|
||||
Peerstore: s.peers,
|
||||
}
|
||||
|
||||
// If we are attempting to connect to a loopback addr, fail out early
|
||||
// If we are attempting to connect to the zero addr, fail out early
|
||||
raddr := peer.NetAddress("tcp")
|
||||
if raddr == nil {
|
||||
return nil, fmt.Errorf("No remote address for network tcp")
|
||||
|
@ -115,7 +115,7 @@ func GetenvBool(name string) bool {
|
||||
// IsLoopbackAddr returns whether or not the ip portion of the passed in multiaddr
|
||||
// string is a loopback address
|
||||
func IsLoopbackAddr(addr string) bool {
|
||||
loops := []string{"/ip4/127.0.0.1", "/ip6/::1", "/ip4/0.0.0.0"}
|
||||
loops := []string{"/ip4/127.0.0.1", "/ip6/::1"}
|
||||
for _, loop := range loops {
|
||||
if strings.HasPrefix(addr, loop) {
|
||||
return true
|
||||
|
Reference in New Issue
Block a user