mirror of
https://github.com/logos-messaging/logos-messaging-go-bindings.git
synced 2026-01-02 05:53:07 +00:00
fix: return value check, support numShardsInNetwork
This commit is contained in:
parent
aba84ffc7b
commit
d750a706a1
@ -36,4 +36,5 @@ type WakuConfig struct {
|
||||
DnsAddrsNameServers []string `json:"dnsAddrsNameServers,omitempty"`
|
||||
Discv5EnrAutoUpdate bool `json:"discv5EnrAutoUpdate,omitempty"`
|
||||
MaxConnections int `json:"maxConnections,omitempty"`
|
||||
NumShardsInNetwork uint16 `json:"numShardsInNetwork"`
|
||||
}
|
||||
|
||||
@ -398,16 +398,16 @@ func NewWakuNode(config *common.WakuConfig, nodeName string) (*WakuNode, error)
|
||||
defer C.free(unsafe.Pointer(cJsonConfig))
|
||||
defer C.freeResp(resp)
|
||||
|
||||
wg.Add(1)
|
||||
n.wakuCtx = C.cGoWakuNew(cJsonConfig, resp)
|
||||
wg.Wait()
|
||||
|
||||
if C.getRet(resp) != C.RET_OK {
|
||||
errMsg := C.GoStringN(C.getMyCharPtr(resp), C.int(C.getMyCharLen(resp)))
|
||||
Error("error wakuNew for %s: %v", nodeName, errMsg)
|
||||
return nil, errors.New(errMsg)
|
||||
}
|
||||
|
||||
wg.Add(1)
|
||||
n.wakuCtx = C.cGoWakuNew(cJsonConfig, resp)
|
||||
wg.Wait()
|
||||
|
||||
n.MsgChan = make(chan common.Envelope, MsgChanBufferSize)
|
||||
n.TopicHealthChan = make(chan topicHealth, TopicHealthChanBufferSize)
|
||||
n.ConnectionChangeChan = make(chan connectionChange, ConnectionChangeChanBufferSize)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user