mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 22:26:30 +00:00
18 lines
370 B
Go
18 lines
370 B
Go
package peers
|
|
|
|
import (
|
|
"github.com/ethereum/go-ethereum/p2p"
|
|
"github.com/status-im/status-go/signal"
|
|
)
|
|
|
|
// SendDiscoverySummary sends discovery.summary signal.
|
|
func SendDiscoverySummary(peers []*p2p.PeerInfo) {
|
|
summary := map[string]int{}
|
|
for i := range peers {
|
|
for _, cap := range peers[i].Caps {
|
|
summary[cap]++
|
|
}
|
|
}
|
|
signal.SendDiscoverySummary(summary)
|
|
}
|