chore: upgrade peer exchange mounting (#2953)

This commit is contained in:
Darshan K 2024-08-06 13:27:25 +05:30 committed by GitHub
parent f534549a1e
commit 42f1bed04c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 8 deletions

View File

@ -338,20 +338,20 @@ proc setupProtocols(
return err("failed to set node waku filter peer: " & filterNode.error) return err("failed to set node waku filter peer: " & filterNode.error)
# waku peer exchange setup # waku peer exchange setup
if conf.peerExchangeNode != "" or conf.peerExchange: if conf.peerExchange:
try: try:
await mountPeerExchange(node, some(conf.clusterId)) await mountPeerExchange(node, some(conf.clusterId))
except CatchableError: except CatchableError:
return return
err("failed to mount waku peer-exchange protocol: " & getCurrentExceptionMsg()) err("failed to mount waku peer-exchange protocol: " & getCurrentExceptionMsg())
if conf.peerExchangeNode != "": if conf.peerExchangeNode != "":
let peerExchangeNode = parsePeerInfo(conf.peerExchangeNode) let peerExchangeNode = parsePeerInfo(conf.peerExchangeNode)
if peerExchangeNode.isOk(): if peerExchangeNode.isOk():
node.peerManager.addServicePeer(peerExchangeNode.value, WakuPeerExchangeCodec) node.peerManager.addServicePeer(peerExchangeNode.value, WakuPeerExchangeCodec)
else: else:
return return
err("failed to set node waku peer-exchange peer: " & peerExchangeNode.error) err("failed to set node waku peer-exchange peer: " & peerExchangeNode.error)
return ok() return ok()