aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discv5/node.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-12-15 00:40:49 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-12-15 00:40:49 +0800
commit2573094df2b3f2fad03ce465694f24e9899a31e4 (patch)
tree7f3b1a83dd531944d82ccd243ef5a51cf63f6f4a /p2p/discv5/node.go
parent745026b7b4fbbb3036a3d456a26db35fac4e3374 (diff)
downloadgo-tangerine-2573094df2b3f2fad03ce465694f24e9899a31e4.tar
go-tangerine-2573094df2b3f2fad03ce465694f24e9899a31e4.tar.gz
go-tangerine-2573094df2b3f2fad03ce465694f24e9899a31e4.tar.bz2
go-tangerine-2573094df2b3f2fad03ce465694f24e9899a31e4.tar.lz
go-tangerine-2573094df2b3f2fad03ce465694f24e9899a31e4.tar.xz
go-tangerine-2573094df2b3f2fad03ce465694f24e9899a31e4.tar.zst
go-tangerine-2573094df2b3f2fad03ce465694f24e9899a31e4.zip
p2p/discover, p2p/discv5: use flexible comparison for IPs
Diffstat (limited to 'p2p/discv5/node.go')
-rw-r--r--p2p/discv5/node.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/p2p/discv5/node.go b/p2p/discv5/node.go
index b6b6f149d..b2025ebcb 100644
--- a/p2p/discv5/node.go
+++ b/p2p/discv5/node.go
@@ -17,7 +17,6 @@
package discv5
import (
- "bytes"
"crypto/ecdsa"
"crypto/elliptic"
"encoding/hex"
@@ -81,7 +80,7 @@ func (n *Node) addrEqual(a *net.UDPAddr) bool {
if ipv4 := a.IP.To4(); ipv4 != nil {
ip = ipv4
}
- return n.UDP == uint16(a.Port) && bytes.Equal(n.IP, ip)
+ return n.UDP == uint16(a.Port) && n.IP.Equal(ip)
}
// Incomplete returns true for nodes with no IP address.