p2p/discover: waitForNodes hangs on RespCount=0 from peer (#35043)

The first NODES response sets total = min(int(response.RespCount),
totalNodesResponseLimit), With RespCount=0, total=0 but receive become
1; receive == count is never satisfied.
This commit is contained in:
cui 2026-05-26 20:18:47 +08:00 committed by GitHub
parent ca1a027fae
commit 9429725d2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -464,7 +464,7 @@ func (t *UDPv5) waitForNodes(c *callV5, distances []uint) ([]*enode.Node, error)
if total == -1 {
total = min(int(response.RespCount), totalNodesResponseLimit)
}
if received++; received == total {
if received++; received >= total {
return nodes, nil
}
case err := <-c.err: