From f5c95a6a6e13dc334851e21be5028936145bf4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CGheisMohammadi=E2=80=9D?= <36589218+GheisMohammadi@users.noreply.github.com> Date: Fri, 3 Feb 2023 17:04:14 +0800 Subject: [PATCH] add a separate log for get max height error --- api/service/legacysync/syncing.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/api/service/legacysync/syncing.go b/api/service/legacysync/syncing.go index 51366ab94..43f07c039 100644 --- a/api/service/legacysync/syncing.go +++ b/api/service/legacysync/syncing.go @@ -1085,7 +1085,16 @@ func (ss *StateSync) SyncLoop(bc core.BlockChain, worker *worker.Worker, isBeaco start := time.Now() currentHeight := bc.CurrentBlock().NumberU64() otherHeight, errMaxHeight := getMaxPeerHeight(ss.syncConfig) - if errMaxHeight != nil || currentHeight >= otherHeight { + if errMaxHeight != nil { + utils.Logger().Error(). + Bool("isBeacon", isBeacon). + Uint32("ShardID", bc.ShardID()). + Uint64("currentHeight", currentHeight). + Int("peers count", ss.syncConfig.PeersCount()). + Msgf("[SYNC] get max height failed") + break + } + if currentHeight >= otherHeight { utils.Logger().Info(). Msgf("[SYNC] Node is now IN SYNC! (isBeacon: %t, ShardID: %d, otherHeight: %d, currentHeight: %d)", isBeacon, bc.ShardID(), otherHeight, currentHeight)