aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/udp.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2018-02-17 03:16:23 +0800
committerFelix Lange <fjl@twurst.com>2018-02-17 04:29:20 +0800
commitaeedec4078647c22244552803c88521391224ab1 (patch)
tree2cead3501991bb474f0a50727b625fea75700797 /p2p/discover/udp.go
parent32301a4d6b3a9684e954057e7cdb15998764122b (diff)
downloaddexon-aeedec4078647c22244552803c88521391224ab1.tar
dexon-aeedec4078647c22244552803c88521391224ab1.tar.gz
dexon-aeedec4078647c22244552803c88521391224ab1.tar.bz2
dexon-aeedec4078647c22244552803c88521391224ab1.tar.lz
dexon-aeedec4078647c22244552803c88521391224ab1.tar.xz
dexon-aeedec4078647c22244552803c88521391224ab1.tar.zst
dexon-aeedec4078647c22244552803c88521391224ab1.zip
p2p/discover: s/lastPong/bondTime/, update TestUDP_findnode
I forgot to change the check in udp.go when I changed Table.bond to be based on lastPong instead of node presence in db. Rename lastPong to bondTime and add hasBond so it's clearer what this DB key is used for now.
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 5cc0b3d74..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 age := time.Since(t.db.lastPong(fromID)); age > nodeDBNodeExpiration {
+ 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