mirror of
https://github.com/logos-messaging/logos-messaging-go-bindings.git
synced 2026-01-02 14:03:10 +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"`
|
DnsAddrsNameServers []string `json:"dnsAddrsNameServers,omitempty"`
|
||||||
Discv5EnrAutoUpdate bool `json:"discv5EnrAutoUpdate,omitempty"`
|
Discv5EnrAutoUpdate bool `json:"discv5EnrAutoUpdate,omitempty"`
|
||||||
MaxConnections int `json:"maxConnections,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.free(unsafe.Pointer(cJsonConfig))
|
||||||
defer C.freeResp(resp)
|
defer C.freeResp(resp)
|
||||||
|
|
||||||
|
wg.Add(1)
|
||||||
|
n.wakuCtx = C.cGoWakuNew(cJsonConfig, resp)
|
||||||
|
wg.Wait()
|
||||||
|
|
||||||
if C.getRet(resp) != C.RET_OK {
|
if C.getRet(resp) != C.RET_OK {
|
||||||
errMsg := C.GoStringN(C.getMyCharPtr(resp), C.int(C.getMyCharLen(resp)))
|
errMsg := C.GoStringN(C.getMyCharPtr(resp), C.int(C.getMyCharLen(resp)))
|
||||||
Error("error wakuNew for %s: %v", nodeName, errMsg)
|
Error("error wakuNew for %s: %v", nodeName, errMsg)
|
||||||
return nil, errors.New(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.MsgChan = make(chan common.Envelope, MsgChanBufferSize)
|
||||||
n.TopicHealthChan = make(chan topicHealth, TopicHealthChanBufferSize)
|
n.TopicHealthChan = make(chan topicHealth, TopicHealthChanBufferSize)
|
||||||
n.ConnectionChangeChan = make(chan connectionChange, ConnectionChangeChanBufferSize)
|
n.ConnectionChangeChan = make(chan connectionChange, ConnectionChangeChanBufferSize)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user