From 0953ba8009f5e780f13686c1e2d3a631115962e3 Mon Sep 17 00:00:00 2001 From: Tudor Malene Date: Tue, 28 May 2024 12:16:39 +0100 Subject: [PATCH] replace health-check db query (#1938) (cherry picked from commit 1daffac0341ea9935049d1e5d3a0d80730293c09) --- go/enclave/storage/storage.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/go/enclave/storage/storage.go b/go/enclave/storage/storage.go index 70d9b09ba4..a0f16b73a4 100644 --- a/go/enclave/storage/storage.go +++ b/go/enclave/storage/storage.go @@ -339,13 +339,13 @@ func (s *storageImpl) IsBlockAncestor(ctx context.Context, block *types.Block, m func (s *storageImpl) HealthCheck(ctx context.Context) (bool, error) { defer s.logDuration("HealthCheck", measure.NewStopwatch()) - headBatch, err := s.FetchHeadBatch(ctx) + seqNo, err := s.FetchCurrentSequencerNo(ctx) if err != nil { return false, err } - if headBatch == nil { - return false, fmt.Errorf("head batch is nil") + if seqNo == nil { + return false, fmt.Errorf("no batches are stored") } return true, nil