From 9cdc7364ff4a18c0ce90bd464c8288ebeaf9a8a7 Mon Sep 17 00:00:00 2001 From: niklr Date: Thu, 11 Aug 2022 16:21:58 +0000 Subject: [PATCH] fix: handle startHeight > endHeight --- rpcapi/api/ledger_v2.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rpcapi/api/ledger_v2.go b/rpcapi/api/ledger_v2.go index 02adc95df..b8b212c86 100644 --- a/rpcapi/api/ledger_v2.go +++ b/rpcapi/api/ledger_v2.go @@ -473,6 +473,9 @@ func GetLogs(c chain.Chain, rangeMap map[string]*Range, topics [][]types.Hash, p if endHeight == 0 || endHeight > acc.Height { endHeight = acc.Height } + if startHeight > endHeight { + continue + } for { offset, count, finish := getHeightPage(startHeight, endHeight, 100) if count == 0 {