mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-27 07:06:42 +00:00
fix: parse shards properly in enr config for non twn (#2633)
This commit is contained in:
parent
2a4c0f1543
commit
6e6cb298a3
@ -32,7 +32,15 @@ proc enrConfiguration*(
|
||||
let shards: seq[uint16] =
|
||||
# no shards configured
|
||||
if conf.shards.len == 0:
|
||||
toSeq(0 ..< conf.pubsubTopics.len).mapIt(uint16(it))
|
||||
var shardsLocal = newSeq[uint16]()
|
||||
let shardsRes = topicsToRelayShards(conf.pubsubTopics)
|
||||
if shardsRes.isOk() and shardsRes.get().isSome():
|
||||
shardsLocal = shardsRes.get().get().shardIds
|
||||
else:
|
||||
error "failed to parse pubsub topic, please format according to static shard specification",
|
||||
error = shardsRes.error
|
||||
shardsLocal
|
||||
|
||||
# some shards configured
|
||||
else:
|
||||
toSeq(conf.shards.mapIt(uint16(it)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user