Add TotalPeerCount to router api

This commit is contained in:
Devon Hudson 2023-01-11 11:49:01 -07:00
parent 56892e4ae5
commit 61850f0e63
No known key found for this signature in database
GPG key ID: CD06B18E77F6A628

View file

@ -277,3 +277,11 @@ func (r *Router) PeerCount(peertype int) (count int) {
})
return
}
// TotalPeerCount returns the total number of nodes that are directly connected
// to this Pinecone node.
func (r *Router) TotalPeerCount() (count int) {
// PeerCount treats values < 0 specially, returning the count of all connected
// peers, regardless of type.
return r.PeerCount(-1)
}