From d23c70fcc84022fa1f4c227b57ad4eb8c58043ef Mon Sep 17 00:00:00 2001 From: CHAMI Rachid Date: Mon, 17 Apr 2023 21:13:04 +0200 Subject: [PATCH] chore: remove unused heightsByQuery function (#998) --- rpc/core/blocks.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/rpc/core/blocks.go b/rpc/core/blocks.go index f692c280c7..05c83bb2ee 100644 --- a/rpc/core/blocks.go +++ b/rpc/core/blocks.go @@ -470,23 +470,6 @@ func BlockSearch( return &ctypes.ResultBlockSearch{Blocks: apiResults, TotalCount: totalCount}, nil } -// heightsByQuery returns a list of heights corresponding to the provided query. -func heightsByQuery(ctx *rpctypes.Context, query string) ([]int64, error) { - env := GetEnvironment() - // skip if block indexing is disabled - if _, ok := env.BlockIndexer.(*blockidxnull.BlockerIndexer); ok { - return nil, errors.New("block indexing is disabled") - } - - q, err := cmtquery.New(query) - if err != nil { - return nil, err - } - - results, err := env.BlockIndexer.Search(ctx.Context(), q) - return results, err -} - // sortBlocks takes a list of block heights and sorts them according to the order: "asc" or "desc". // If `orderBy` is blank, then it is considered descending. func sortBlocks(results []int64, orderBy string) error {