Skip to content

Commit 91018a4

Browse files
committed
p2p/discover: only get the peer nodes in netrestrict config
1 parent 4766b11 commit 91018a4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

p2p/discover/v5_udp.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@ func (t *UDPv5) verifyResponseNode(c *callV5, r *enr.Record, distances []uint, s
407407
if err := netutil.CheckRelayIP(c.node.IP(), node.IP()); err != nil {
408408
return nil, err
409409
}
410+
if t.netrestrict != nil && !t.netrestrict.Contains(node.IP()) {
411+
return nil, errors.New("not contained in netrestrict list")
412+
}
410413
if c.node.UDP() <= 1024 {
411414
return nil, errLowPort
412415
}

0 commit comments

Comments
 (0)