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().
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 callingClosestPeerIDs
and callDial
on each ID.This PR introduces a type that wraps connection and ID, to be returned by
ClosestPeers()
.