libp2p / go-libp2p-discovery

Active Peer Discovery
MIT License
53 stars 13 forks source link

Possible deadlock in FindPeers #67

Closed r0qs closed 3 years ago

r0qs commented 3 years ago

Hi, I don't know if this library still maintained, but if chLen is smaller than c.prevPeers a deadlock can occur here due to a full buffered channel, no?

I suppose that the comparison in this line was intended to be the inverse logic: chLen < len(c.prevPeers), which fix the deadlock.