From 5110162200f674c7c59c0db949b135f0b2ffb5c9 Mon Sep 17 00:00:00 2001 From: Max N Date: Thu, 10 Feb 2022 22:01:52 +0200 Subject: [PATCH] check every block --- watcher/network_monitor.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/watcher/network_monitor.go b/watcher/network_monitor.go index 10e2b1e..af9ec41 100644 --- a/watcher/network_monitor.go +++ b/watcher/network_monitor.go @@ -115,7 +115,17 @@ func Scan(n int, chainName string, v *ValidatorInfo) { } } - time.Sleep(10 * time.Second) + for i := 0; i >= 0; i++ { + lb, err := client.ABCIInfo(ctx) + if err == nil { + if lb.Response.LastBlockHeight > v.Validators[0].Participation.CheckedBlock { + v.Validators[0].Participation.CheckedBlock = lb.Response.LastBlockHeight + i = -2 + } else { + time.Sleep(1 * time.Second) + } + } + } } }