return empty if the offset*page is greater than tx len

pull/1673/head
Minh Doan 5 years ago
parent dac42117ee
commit 8e379f0448
  1. 4
      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]

Loading…
Cancel
Save