mirror of https://github.com/waku-org/nwaku.git
chore: upgrade peer exchange mounting (#2953)
This commit is contained in:
parent
f534549a1e
commit
42f1bed04c
|
@ -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()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue