From a217a5033a10589ef0a22e087e5b4341983218b6 Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 2 Nov 2023 22:06:01 +0000 Subject: [PATCH] fix(Nodes): check health only for enabled node --- src/lib/nodes/abstract.node.ts | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/lib/nodes/abstract.node.ts b/src/lib/nodes/abstract.node.ts index 898b7028d..37d9dfa14 100644 --- a/src/lib/nodes/abstract.node.ts +++ b/src/lib/nodes/abstract.node.ts @@ -110,17 +110,22 @@ export abstract class Node { async startHealthcheck() { clearInterval(this.timer) - try { - const health = await this.checkHealth() - - this.height = health.height - this.ping = health.ping - this.online = true - } catch (err) { - this.online = false + + // Check health only for enabled nodes + if (this.active) { + try { + const health = await this.checkHealth() + + this.height = health.height + this.ping = health.ping + this.online = true + } catch (err) { + this.online = false + } + + this.fireStatusChange() } - this.fireStatusChange() this.timer = setTimeout(() => this.startHealthcheck(), REVISE_CONNECTION_TIMEOUT) }