commit
7acabfe9f6
1 changed files with 5 additions and 1 deletions
|
@ -51,7 +51,11 @@ func NewPeerKey(peerID string, ip net.IP) PeerKey {
|
|||
}
|
||||
|
||||
func (pk PeerKey) IP() net.IP {
|
||||
return net.ParseIP(strings.Split(string(pk), "//")[1])
|
||||
ip := net.ParseIP(strings.Split(string(pk), "//")[1])
|
||||
if rval := ip.To4(); rval != nil {
|
||||
return rval
|
||||
}
|
||||
return ip
|
||||
}
|
||||
|
||||
func (pk PeerKey) PeerID() string {
|
||||
|
|
Loading…
Reference in a new issue