mirror of
https://github.com/status-im/status-go.git
synced 2025-02-18 01:37:22 +00:00
nwaku.go: GetNumConnectedPeers controls when passed pubsub is empty
This commit is contained in:
parent
6954612f54
commit
8cf6cdcd27
@ -2219,7 +2219,14 @@ func (self *NWaku) ListPeersInMesh(pubsubTopic string) (int, error) {
|
|||||||
return 0, errors.New(errMsg)
|
return 0, errors.New(errMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *NWaku) GetNumConnectedPeers(pubsubTopic string) (int, error) {
|
func (self *NWaku) GetNumConnectedPeers(paramPubsubTopic ...string) (int, error) {
|
||||||
|
var pubsubTopic string
|
||||||
|
if len(paramPubsubTopic) == 0 {
|
||||||
|
pubsubTopic = ""
|
||||||
|
} else {
|
||||||
|
pubsubTopic = paramPubsubTopic[0]
|
||||||
|
}
|
||||||
|
|
||||||
var resp = C.allocResp()
|
var resp = C.allocResp()
|
||||||
var cPubsubTopic = C.CString(pubsubTopic)
|
var cPubsubTopic = C.CString(pubsubTopic)
|
||||||
defer C.freeResp(resp)
|
defer C.freeResp(resp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user