Merge pull request #33 from psaab/develop

Fix IPv4 stats
This commit is contained in:
Cooper Lees
2014-09-29 12:04:18 -07:00
+5 -1
View File
@@ -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 {