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 e931fa5dc8
commit 5d853b8630
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

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"