From 8e379f0448203fe4fdc96aa4aeec3787936e8e15 Mon Sep 17 00:00:00 2001 From: Minh Doan Date: Thu, 26 Sep 2019 17:39:17 -0700 Subject: [PATCH] return empty if the offset*page is greater than tx len --- api/service/explorer/service.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/service/explorer/service.go b/api/service/explorer/service.go index 65750064b..2184a318f 100644 --- a/api/service/explorer/service.go +++ b/api/service/explorer/service.go @@ -765,7 +765,9 @@ func (s *Service) GetExplorerAddress(w http.ResponseWriter, r *http.Request) { } data.Address.TXs = sentTXs } - if offset*page+offset > len(data.Address.TXs) { + if offset*page >= len(data.Address.TXs) { + data.Address.TXs = []*Transaction{} + } else if offset*page+offset > len(data.Address.TXs) { data.Address.TXs = data.Address.TXs[offset*page:] } else { data.Address.TXs = data.Address.TXs[offset*page : offset*page+offset]