mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
p2p: skip netrestrict check for nodes without resolved IP
Hostname-only static nodes have no valid IP at checkDial time and are resolved later in dialTask. Applying netrestrict to them incorrectly rejected the dial before resolution could happen.
This commit is contained in:
parent
c8953d10c2
commit
183d7a17ff
1 changed files with 1 additions and 1 deletions
|
|
@ -428,7 +428,7 @@ func (d *dialScheduler) checkDial(n *enode.Node) error {
|
||||||
if _, ok := d.pendingInbound[n.ID()]; ok {
|
if _, ok := d.pendingInbound[n.ID()]; ok {
|
||||||
return errPendingInbound
|
return errPendingInbound
|
||||||
}
|
}
|
||||||
if d.netRestrict != nil && !d.netRestrict.ContainsAddr(n.IPAddr()) {
|
if d.netRestrict != nil && n.IPAddr().IsValid() && !d.netRestrict.ContainsAddr(n.IPAddr()) {
|
||||||
return errNetRestrict
|
return errNetRestrict
|
||||||
}
|
}
|
||||||
if d.history.contains(string(n.ID().Bytes())) {
|
if d.history.contains(string(n.ID().Bytes())) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue