Add access func for peercount

This commit is contained in:
Jazz Turner-Baggs 2025-09-12 10:28:24 -07:00
parent 5be16419a1
commit 07607e078b
No known key found for this signature in database

View File

@ -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