mirror of https://github.com/waku-org/nwaku.git
implementing comments
This commit is contained in:
parent
d5132edfe1
commit
32675a8471
|
@ -117,16 +117,10 @@ proc setupProtocols(
|
|||
## Optionally include persistent message storage.
|
||||
## No protocols are started yet.
|
||||
|
||||
var shardCount: uint32
|
||||
if conf.pubsubTopics.len > 0:
|
||||
shardCount = uint32(conf.pubsubTopics.len)
|
||||
else:
|
||||
shardCount = uint32(conf.shards.len)
|
||||
|
||||
node.mountMetadata(conf.clusterId).isOkOr:
|
||||
return err("failed to mount waku metadata protocol: " & error)
|
||||
|
||||
node.mountSharding(conf.clusterId, shardCount).isOkOr:
|
||||
node.mountSharding(conf.clusterId, uint32(conf.pubsubTopics.len)).isOkOr:
|
||||
return err("failed to mount waku sharding: " & error)
|
||||
|
||||
# Mount relay on all nodes
|
||||
|
|
|
@ -348,11 +348,6 @@ proc onConnEvent(pm: PeerManager, peerId: PeerID, event: ConnEvent) {.async.} =
|
|||
discard
|
||||
|
||||
proc onPeerMetadata(pm: PeerManager, peerId: PeerId) {.async.} =
|
||||
# To prevent metadata protocol from breaking prev nodes, by now we only
|
||||
# disconnect if the clusterid is specified.
|
||||
if pm.wakuMetadata.clusterId == 0:
|
||||
return
|
||||
|
||||
let res = catch:
|
||||
await pm.switch.dial(peerId, WakuMetadataCodec)
|
||||
|
||||
|
|
Loading…
Reference in New Issue