perlin-network / noise

A decentralized P2P networking stack written in Go.
https://godoc.org/github.com/perlin-network/noise
MIT License
1.78k stars 213 forks source link

Implement a type to wrap conn and id, returned by ClosestPeers #257

Closed AhmadMuzakkir closed 4 years ago

AhmadMuzakkir commented 4 years ago

Currently, ClosestPeers() returns a list of connections, without their IDs. What if we also want connection ID ? The only way get both ID and connection is to do it yourself, by manually calling ClosestPeerIDs and call Dial on each ID.

This PR introduces a type that wraps connection and ID, to be returned by ClosestPeers().