Skip to content

Commit c47e5c8

Browse files
committed
Fix lint issue
1 parent 2e42409 commit c47e5c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/blockchain/ethereum.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,10 @@ func (e *EthereumClient) startHeaderPolling() error {
13851385
for blockNum := lastHeaderNumber + 1; blockNum <= latestHeader.Number.Uint64(); blockNum++ {
13861386
// Create a new context with timeout for each HeaderByNumber call
13871387
blockCtx, blockCancel := context.WithTimeout(context.Background(), e.NetworkConfig.Timeout.Duration)
1388+
if blockNum > math.MaxInt64 {
1389+
e.l.Error().Int64("Chain Id", e.GetChainID().Int64()).Uint64("BlockNumber", blockNum).Msg("blockNum exceeds the maximum value for int64")
1390+
continue
1391+
}
13881392
header, err := e.HeaderByNumber(blockCtx, big.NewInt(int64(blockNum)))
13891393
blockCancel()
13901394
if err != nil {

0 commit comments

Comments
 (0)