diff --git a/app/rpc/namespaces/eth/filters/filters.go b/app/rpc/namespaces/eth/filters/filters.go index 174da20c4e..23e6658887 100644 --- a/app/rpc/namespaces/eth/filters/filters.go +++ b/app/rpc/namespaces/eth/filters/filters.go @@ -110,7 +110,9 @@ func (f *Filter) Logs(ctx context.Context) ([]*ethtypes.Log, error) { if f.criteria.ToBlock.Int64() == -1 { f.criteria.ToBlock = big.NewInt(head) } - + if f.criteria.ToBlock.Int64() > head { + f.criteria.ToBlock = big.NewInt(head) + } if f.criteria.FromBlock.Int64() <= tmtypes.GetStartBlockHeight() || f.criteria.ToBlock.Int64() <= tmtypes.GetStartBlockHeight() { return nil, fmt.Errorf("from and to block height must greater than %d", tmtypes.GetStartBlockHeight())