diff --git a/state/indexer/block/kv/kv.go b/state/indexer/block/kv/kv.go index cd7f6ee84..479dcbd6f 100644 --- a/state/indexer/block/kv/kv.go +++ b/state/indexer/block/kv/kv.go @@ -113,11 +113,6 @@ func (idx *BlockerIndexer) Search(ctx context.Context, q *query.Query) ([]int64, if matchEvents { matchEventIdx = 0 - } else { - matchEventIdx = -1 - } - - if matchEventIdx != -1 { skipIndexes = append(skipIndexes, matchEventIdx) } diff --git a/state/indexer/block/kv/util.go b/state/indexer/block/kv/util.go index 82632241e..3eac2d7b0 100644 --- a/state/indexer/block/kv/util.go +++ b/state/indexer/block/kv/util.go @@ -142,7 +142,7 @@ func lookForHeight(conditions []query.Condition) (int64, bool, int) { return 0, false, -1 } -func dedupHeight(conditions []query.Condition) (dedupConditions []query.Condition, heightInfo HeightInfo, found bool) { //} height int64, found bool, idx int) { +func dedupHeight(conditions []query.Condition) (dedupConditions []query.Condition, heightInfo HeightInfo, found bool) { heightInfo.heightEqIdx = -1 heightRangeExists := false var heightCondition []query.Condition @@ -183,7 +183,7 @@ func dedupHeight(conditions []query.Condition) (dedupConditions []query.Conditio heightInfo.heightEqIdx = 0 heightInfo.onlyHeightEq = false } - return + return dedupConditions, heightInfo, found } func dedupMatchEvents(conditions []query.Condition) ([]query.Condition, bool) { diff --git a/state/txindex/kv/kv.go b/state/txindex/kv/kv.go index 728090c4a..128da2a1b 100644 --- a/state/txindex/kv/kv.go +++ b/state/txindex/kv/kv.go @@ -236,8 +236,6 @@ func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*abci.TxResul if matchEvents { matchEventIdx = 0 skipIndexes = append(skipIndexes, matchEventIdx) - } else { - matchEventIdx = -1 } // if there is a height condition ("tx.height=3"), extract it diff --git a/state/txindex/kv/utils.go b/state/txindex/kv/utils.go index 2d1d93ebb..25467030e 100644 --- a/state/txindex/kv/utils.go +++ b/state/txindex/kv/utils.go @@ -64,7 +64,7 @@ func ParseEventSeqFromEventKey(key []byte) (int64, error) { return eventSeq, nil } -func dedupHeight(conditions []query.Condition) (dedupConditions []query.Condition, heightInfo HeightInfo) { //} height int64, found bool, idx int) { +func dedupHeight(conditions []query.Condition) (dedupConditions []query.Condition, heightInfo HeightInfo) { heightInfo.heightEqIdx = -1 heightRangeExists := false var heightCondition []query.Condition @@ -103,7 +103,7 @@ func dedupHeight(conditions []query.Condition) (dedupConditions []query.Conditio heightInfo.heightEqIdx = 0 heightInfo.onlyHeightEq = false } - return + return dedupConditions, heightInfo } func checkHeightConditions(heightInfo HeightInfo, keyHeight int64) bool {