Skip to content

Commit

Permalink
implementing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmer committed Jun 10, 2024
1 parent d5132ed commit 32675a8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
8 changes: 1 addition & 7 deletions waku/factory/node_factory.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions waku/node/peer_manager/peer_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 32675a8

Please sign in to comment.