From 01117acbcc2c301b15b3b446da392bb81a427818 Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Thu, 19 May 2022 14:41:49 +0300 Subject: [PATCH] fmt --- eth/downloader/whitelist/service.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eth/downloader/whitelist/service.go b/eth/downloader/whitelist/service.go index 4e23c4095b..2ddad0e5ab 100644 --- a/eth/downloader/whitelist/service.go +++ b/eth/downloader/whitelist/service.go @@ -12,7 +12,7 @@ import ( // Checkpoint whitelist type Service struct { - m sync.RWMutex + m sync.Mutex checkpointWhitelist map[uint64]common.Hash // Checkpoint whitelist, populated by reaching out to heimdall checkpointOrder []uint64 // Checkpoint order, populated by reaching out to heimdall maxCapacity uint @@ -54,6 +54,7 @@ func (w *Service) IsValidChain(remoteHeader *types.Header, fetchHeadersByNumber if err != nil { return false, fmt.Errorf("%w: last checkpoint %d, err %v", ErrNoRemoteCheckoint, lastCheckpointBlockNum, err) } + if len(headers) == 0 { return true, fmt.Errorf("%w: last checkpoint %d", ErrNoRemoteCheckoint, lastCheckpointBlockNum) }