From 959fc0e128a60166ae9f9833daedcc13b879e679 Mon Sep 17 00:00:00 2001 From: Chris Marslender Date: Wed, 19 Apr 2023 09:48:51 -0500 Subject: [PATCH] Ensure block height is increasing --- internal/healthcheck/healthcheck.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/healthcheck/healthcheck.go b/internal/healthcheck/healthcheck.go index 66e7eb7..821d887 100644 --- a/internal/healthcheck/healthcheck.go +++ b/internal/healthcheck/healthcheck.go @@ -110,13 +110,16 @@ func (h *Healthcheck) fullNodeReceive(resp *types.WebsocketResponse) { return } + // Edge case, but we should be sure block height is increasing + if block.Height <= h.lastHeight { + return + } + h.lastHeight = block.Height h.lastHeightTime = time.Now() } -func (h *Healthcheck) walletReceive(resp *types.WebsocketResponse) { - -} +func (h *Healthcheck) walletReceive(resp *types.WebsocketResponse) {} func (h *Healthcheck) crawlerReceive(resp *types.WebsocketResponse) {}