From dd8dc7429d724dff6b7254bd5206a2811223461a Mon Sep 17 00:00:00 2001 From: Ivan FB <128452529+Ivansete-status@users.noreply.github.com> Date: Wed, 11 Feb 2026 16:19:58 +0100 Subject: [PATCH] canary exits with error if ping fails (#3711) --- apps/wakucanary/wakucanary.nim | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/wakucanary/wakucanary.nim b/apps/wakucanary/wakucanary.nim index 6e02c2a8f..40bf4db45 100644 --- a/apps/wakucanary/wakucanary.nim +++ b/apps/wakucanary/wakucanary.nim @@ -278,6 +278,10 @@ proc main(rng: ref HmacDrbgContext): Future[int] {.async.} = pingSuccess = false error "Ping operation failed or timed out", error = exc.msg + if not pingSuccess: + error "Ping to the node failed", peerId = peer.peerId, conStatus = $conStatus + quit(QuitFailure) + if conStatus in [Connected, CanConnect]: let nodeProtocols = lp2pPeerStore[ProtoBook][peer.peerId] @@ -285,11 +289,6 @@ proc main(rng: ref HmacDrbgContext): Future[int] {.async.} = error "Not all protocols are supported", expected = conf.protocols, supported = nodeProtocols quit(QuitFailure) - - # Check ping result if ping was enabled - if conf.ping and not pingSuccess: - error "Node is reachable and supports protocols but ping failed - connection may be unstable" - quit(QuitFailure) elif conStatus == CannotConnect: error "Could not connect", peerId = peer.peerId quit(QuitFailure)