chore: do not mount relay more than once (#1650)

This commit is contained in:
Alvaro Revuelta 2023-04-05 15:12:49 +02:00 committed by GitHub
parent 97f3b7be4e
commit 1088c5f063

View File

@ -413,6 +413,10 @@ proc mountRelay*(node: WakuNode,
topics: seq[string] = @[],
triggerSelf = true,
peerExchangeHandler = none(RoutingRecordsHandler)) {.async, gcsafe.} =
if not node.wakuRelay.isNil():
error "wakuRelay already mounted, skipping"
return
## The default relay topics is the union of all configured topics plus default PubsubTopic(s)
info "mounting relay protocol"