mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
p2p/discover: don't update endpoint for unauthenticated nodes in discv4
This commit is contained in:
parent
af0a3274be
commit
7afcb398e5
1 changed files with 8 additions and 0 deletions
|
|
@ -513,6 +513,14 @@ func (tab *Table) handleAddNode(req addNodeOp) bool {
|
|||
}
|
||||
|
||||
b := tab.bucket(req.node.ID())
|
||||
if !req.isInbound && req.node.Seq() == 0 && contains(b.entries, req.node.ID()) {
|
||||
// Special case for discv4: because endpoint information is not
|
||||
// authenticated, do not update until the node is successfully communicated
|
||||
// with. Therefore, non-inbounds which are already in the bucket should be
|
||||
// skipped.
|
||||
return false
|
||||
|
||||
}
|
||||
if tab.bumpInBucket(b, req.node.Node) {
|
||||
// Already in bucket, update record.
|
||||
return false
|
||||
|
|
|
|||
Loading…
Reference in a new issue