func (node *HostNode) CountPeers(id protocol.ID) int {
	count := 0
	for _, n := range node.host.Peerstore().Peers() {
		if sup, err := node.host.Peerstore().SupportsProtocols(n, string(id)); err != nil && len(sup) != 0 {
			count++
		}
	}
	return count
}
// CountPeers counts the number of peers that support the protocol.
CountPeers counts the number of peers that support the protocol.
// CountPeers counts the number of peers that support the protocol .
func (node *HostNode) CountPeers(id protocol.ID) int {
	count := 0
	for _, n := range node.host.Peerstore().Peers() {
		if sup, err := node.host.Peerstore().SupportsProtocols(n, string(id)); err != nil && len(sup) != 0 {
			count++
		}
	}
	return count
}
func ( node * HostNode ) CountPeers ( id protocol . ID ) int { count := 0 for _ , n := range node . host . Peerstore ( ) . Peers ( ) { if sup , err := node . host . Peerstore ( ) . SupportsProtocols ( n , string ( id ) ) ; err != nil && len ( sup ) != 0 { count ++ } } return count }
CountPeers counts the number of peers that support the protocol.
CountPeers counts the number of peers that support the protocol .