diff --git a/examples/pingpong.nim b/examples/pingpong.nim index ed32e16..6caf000 100644 --- a/examples/pingpong.nim +++ b/examples/pingpong.nim @@ -69,7 +69,7 @@ proc main() {.async.} = await saro.start() await raya.start() - await sleepAsync(5.seconds) + await sleepAsync(10.seconds) # Perform OOB Introduction: Raya -> Saro let raya_bundle = raya.createIntroBundle() @@ -77,8 +77,8 @@ proc main() {.async.} = await sleepAsync(20.seconds) # Run for some time - saro.stop() - raya.stop() + await saro.stop() + await raya.stop() when isMainModule: diff --git a/examples/tui/tui.nim b/examples/tui/tui.nim index 914897f..a3b4716 100644 --- a/examples/tui/tui.nim +++ b/examples/tui/tui.nim @@ -106,10 +106,6 @@ proc getSelectedConvo(app: ChatApp): ptr ConvoInfo = proc createChatClient(name: string): Future[Client] {.async.} = var cfg = await getCfg(name) - # for key, val in fetchRegistrations(): - # if key != name: - # cfg.waku.staticPeers.add(val) - result = newClient(cfg.waku, cfg.ident) diff --git a/src/chat/client.nim b/src/chat/client.nim index ffbdac0..75ad3c0 100644 --- a/src/chat/client.nim +++ b/src/chat/client.nim @@ -291,8 +291,8 @@ proc start*(client: Client) {.async.} = notice "Client start complete", client = client.getId() -proc stop*(client: Client) = +proc stop*(client: Client) {.async.} = ## Stop the client. - client.ds.stop() + await client.ds.stop() client.isRunning = false notice "Client stopped", client = client.getId() diff --git a/src/chat/delivery/waku_client.nim b/src/chat/delivery/waku_client.nim index 4504131..2e871df 100644 --- a/src/chat/delivery/waku_client.nim +++ b/src/chat/delivery/waku_client.nim @@ -206,3 +206,6 @@ proc getConnectedPeerCount*(client: WakuClient): int = if peerInfo.connectedness == Connected: inc count return count + +proc stop*(client: WakuClient) {.async.} = + await client.node.stop()