aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/udp.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-02-18 00:47:44 +0800
committerGitHub <noreply@github.com>2018-02-18 00:47:44 +0800
commit9fd76e33af367752160ab0e33d1097e1e9aff6e4 (patch)
tree2cead3501991bb474f0a50727b625fea75700797 /p2p/discover/udp.go
parent4e61ed02e2d32aa38f5a2f37b87bc52a71657809 (diff)
parentaeedec4078647c22244552803c88521391224ab1 (diff)
downloaddexon-9fd76e33af367752160ab0e33d1097e1e9aff6e4.tar
dexon-9fd76e33af367752160ab0e33d1097e1e9aff6e4.tar.gz
dexon-9fd76e33af367752160ab0e33d1097e1e9aff6e4.tar.bz2
dexon-9fd76e33af367752160ab0e33d1097e1e9aff6e4.tar.lz
dexon-9fd76e33af367752160ab0e33d1097e1e9aff6e4.tar.xz
dexon-9fd76e33af367752160ab0e33d1097e1e9aff6e4.tar.zst
dexon-9fd76e33af367752160ab0e33d1097e1e9aff6e4.zip
Merge pull request #16109 from karalabe/p2p-bond-check
p2p/discover: validate bond against lastpong, not db presence
Diffstat (limited to 'p2p/discover/udp.go')
-rw-r--r--p2p/discover/udp.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/p2p/discover/udp.go b/p2p/discover/udp.go
index e40de2c36..524c6e498 100644
--- a/p2p/discover/udp.go
+++ b/p2p/discover/udp.go
@@ -613,7 +613,7 @@ func (req *findnode) handle(t *udp, from *net.UDPAddr, fromID NodeID, mac []byte
if expired(req.Expiration) {
return errExpired
}
- if t.db.node(fromID) == nil {
+ if !t.db.hasBond(fromID) {
// No bond exists, we don't process the packet. This prevents
// an attack vector where the discovery protocol could be used
// to amplify traffic in a DDOS attack. A malicious actor