From 8b3386c7133bb13ed4267f2d0e300eb36c92d0a6 Mon Sep 17 00:00:00 2001 From: Monkey Date: Thu, 15 May 2025 01:49:43 +0800 Subject: [PATCH] recorrect the fixing --- eth/handler.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eth/handler.go b/eth/handler.go index aaea00e037..902878238a 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -177,7 +177,11 @@ func newHandler(config *handlerConfig) (*handler, error) { } } else { head := h.chain.CurrentBlock() - if head.Number.Uint64() > 0 && h.chain.HasState(head.Root) { + if head.Number.Uint64() == 0 && head.Time > uint64(time.Now().Unix()) { + // Print warning log if the genesis block is in the future. + h.snapSync.Store(false) + log.Warn("Switch sync mode from snap sync to full sync", "reason", "in the future genesis block") + } else if head.Number.Uint64() > 0 && h.chain.HasState(head.Root) { // Print warning log if database is not empty to run snap sync. log.Warn("Switch sync mode from snap sync to full sync", "reason", "snap sync complete") } else {