mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
p2p/discover: reject older records in requestENR
This commit is contained in:
parent
4bdf1a4b99
commit
03c58fc08a
1 changed files with 3 additions and 0 deletions
|
|
@ -551,6 +551,9 @@ func (t *UDPv4) requestENR(n *enode.Node) (*enode.Node, error) {
|
|||
if respN.ID() != n.ID() {
|
||||
return nil, fmt.Errorf("invalid ID in response record")
|
||||
}
|
||||
if respN.Seq() < n.Seq() {
|
||||
return n, nil // response record is older
|
||||
}
|
||||
if err := netutil.CheckRelayIP(addr.IP, respN.IP()); err != nil {
|
||||
return nil, fmt.Errorf("invalid IP in response record: %v", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue