peers.go
func (peers *Peers) Descriptions() []PeerDescription {
	peers.RLock()
	defer peers.RUnlock()
	descriptions := make([]PeerDescription, 0, len(peers.byName))
	for _, peer := range peers.byName {
		descriptions = append(descriptions, PeerDescription{
			Name:           peer.Name,
			NickName:       peer.peerSummary.NickName,
			UID:            peer.UID,
			Self:           peer.Name == peers.ourself.Name,
			NumConnections: len(peer.connections),
		})
	}
	return descriptions
}
func (peers *Peers) Descriptions() []PeerDescription {
	peers.RLock()
	defer peers.RUnlock()
	descriptions := make([]PeerDescription, 0, len(peers.byName))
	for _, peer := range peers.byName {
		descriptions = append(descriptions, PeerDescription{
			Name:           peer.Name,
			NickName:       peer.peerSummary.NickName,
			UID:            peer.UID,
			Self:           peer.Name == peers.ourself.Name,
			NumConnections: len(peer.connections),
		})
	}
	return descriptions
}
// Descriptions returns descriptions for all known peers.