mirror of
https://github.com/logos-messaging/logos-chat.git
synced 2026-02-27 20:33:07 +00:00
Add access func for peercount
This commit is contained in:
parent
5be16419a1
commit
07607e078b
@ -188,3 +188,10 @@ proc initWakuClient*(cfg: WakuConfig): WakuClient =
|
||||
|
||||
proc addDispatchQueue*(client: var WakuClient, queue: QueueRef) =
|
||||
client.dispatchQueues.add(queue)
|
||||
|
||||
proc getConnectedPeerCount*(client: WakuClient): int =
|
||||
var count = 0
|
||||
for peerId, peerInfo in client.node.peerManager.switch.peerStore.peers:
|
||||
if peerInfo.connectedness == Connected:
|
||||
inc count
|
||||
return count
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user