diff --git a/state/indexer/block/kv/util.go b/state/indexer/block/kv/util.go index b146723ba..6c56fe0a2 100644 --- a/state/indexer/block/kv/util.go +++ b/state/indexer/block/kv/util.go @@ -209,8 +209,10 @@ func dedupMatchEvents(conditions []query.Condition) ([]query.Condition, bool) { } func checkHeightConditions(heightInfo HeightInfo, keyHeight int64) bool { - if heightInfo.heightRange.Key != "" && !checkBounds(heightInfo.heightRange, keyHeight) { - return false + if heightInfo.heightRange.Key != "" { + if !checkBounds(heightInfo.heightRange, keyHeight) { + return false + } } else { if heightInfo.height != 0 && keyHeight != heightInfo.height { return false diff --git a/state/txindex/kv/utils.go b/state/txindex/kv/utils.go index 046635344..5b2fc93ba 100644 --- a/state/txindex/kv/utils.go +++ b/state/txindex/kv/utils.go @@ -107,8 +107,10 @@ func dedupHeight(conditions []query.Condition) (dedupConditions []query.Conditio } func checkHeightConditions(heightInfo HeightInfo, keyHeight int64) bool { - if heightInfo.heightRange.Key != "" && !checkBounds(heightInfo.heightRange, keyHeight) { - return false + if heightInfo.heightRange.Key != "" { + if !checkBounds(heightInfo.heightRange, keyHeight) { + return false + } } else { if heightInfo.height != 0 && keyHeight != heightInfo.height { return false