fix: properly using waitgroup in num relay peers api

This commit is contained in:
Gabriel mermelstein 2025-02-03 10:39:45 +02:00
parent a4db2843d0
commit ce9fb74360
No known key found for this signature in database
GPG Key ID: 82B8134785FEAE0D

View File

@ -595,7 +595,9 @@ func (n *WakuNode) GetNumConnectedRelayPeers(optPubsubTopic ...string) (int, err
var cPubsubTopic = C.CString(pubsubTopic)
defer C.free(unsafe.Pointer(cPubsubTopic))
wg.Add(1)
C.cGoWakuGetNumConnectedRelayPeers(n.wakuCtx, cPubsubTopic, resp)
wg.Wait()
if C.getRet(resp) == C.RET_OK {
numPeersStr := C.GoStringN(C.getMyCharPtr(resp), C.int(C.getMyCharLen(resp)))