From 4d760440fc640d7760c45964efebc8a95ed8141c Mon Sep 17 00:00:00 2001 From: Conflux Date: Mon, 4 Nov 2024 10:13:03 +0800 Subject: [PATCH] minor fix --- rpc/handler/cfx_logs.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rpc/handler/cfx_logs.go b/rpc/handler/cfx_logs.go index b0f6c5b..1920960 100644 --- a/rpc/handler/cfx_logs.go +++ b/rpc/handler/cfx_logs.go @@ -149,7 +149,11 @@ func (handler *CfxLogsApiHandler) getLogsReorgGuard( // convert block number range back to epoch number range for log filter with epoch range if filter.FromEpoch != nil { var valErr *store.SuggestedFilterOversizedError[store.SuggestedBlockRange] - if errors.As(err, &valErr) && valErr.SuggestedRange.MaxEndEpoch != 0 { + if errors.As(err, &valErr) { + if valErr.SuggestedRange.MaxEndEpoch == 0 { + return nil, false, valErr.Unwrap() + } + fromEpoch, _ := filter.FromEpoch.ToInt() maxPossibleEpochNum := valErr.SuggestedRange.MaxEndEpoch endBlockNum := valErr.SuggestedRange.To