diff --git a/pkg/network/server.go b/pkg/network/server.go index 10970a301..ae77a016b 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -839,12 +839,15 @@ func (s *Server) requestTx(hashes ...util.Uint256) { return } - for i := 0; i < len(hashes)/payload.MaxHashesCount; i++ { + for i := 0; i <= len(hashes)/payload.MaxHashesCount; i++ { start := i * payload.MaxHashesCount stop := (i + 1) * payload.MaxHashesCount - if stop < len(hashes) { + if stop > len(hashes) { stop = len(hashes) } + if start == stop { + break + } msg := NewMessage(CMDGetData, payload.NewInventory(payload.TXType, hashes[start:stop])) // It's high priority because it directly affects consensus process, // even though it's getdata.