diff --git a/waku/factory/waku.nim b/waku/factory/waku.nim index 27c9437ff..c6196337f 100644 --- a/waku/factory/waku.nim +++ b/waku/factory/waku.nim @@ -362,6 +362,10 @@ proc startDnsDiscoveryRetryLoop(waku: ptr Waku): Future[void] {.async.} = return proc startWaku*(waku: ptr Waku): Future[Result[void, string]] {.async.} = + if waku[].node.started: + warn "startWaku: waku node already started" + return ok() + debug "Retrieve dynamic bootstrap nodes" let conf = waku[].conf @@ -442,6 +446,9 @@ proc startWaku*(waku: ptr Waku): Future[Result[void, string]] {.async.} = proc stop*(waku: Waku): Future[void] {.async: (raises: [Exception]).} = ## Waku shutdown + if not waku.node.started: + warn "stop: attempting to stop node that isn't running" + waku.healthMonitor.setOverallHealth(HealthStatus.SHUTTING_DOWN) if not waku.metricsServer.isNil():