Merge pull request #1673 from mikedoan/fix_explorer

[explorer/service.go]return empty if the offset*page is greater than tx len
pull/1685/head
Minh Doan 5 years ago committed by GitHub
commit b4ffb3f7e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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 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:] data.Address.TXs = data.Address.TXs[offset*page:]
} else { } else {
data.Address.TXs = data.Address.TXs[offset*page : offset*page+offset] data.Address.TXs = data.Address.TXs[offset*page : offset*page+offset]

Loading…
Cancel
Save