mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-04-17 01:03:26 +00:00
fix: add nil checks for libp2pPing and node started status
This commit is contained in:
parent
328f3b6491
commit
dc73cd23b2
@ -38,6 +38,10 @@ proc mountLibp2pPing*(node: WakuNode) {.async: (raises: []).} =
|
||||
|
||||
proc pingPeer(node: WakuNode, peerId: PeerId): Future[Result[void, string]] {.async.} =
|
||||
## Ping a single peer and return the result
|
||||
if node.libp2pPing.isNil():
|
||||
return err("cannot pingPeer because libp2pPing is nil: " & $peerId)
|
||||
if not node.started:
|
||||
return err("cannot pingPeer because node is not started: " & $peerId)
|
||||
|
||||
try:
|
||||
# Establish a stream
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user