Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion graphql/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ func (r *Resolver) Blocks(ctx context.Context, args struct {
if to < from {
return []*Block{}, nil
}
ret := make([]*Block, 0, to-from+1)
var ret []*Block
for i := from; i <= to; i++ {
numberOrHash := rpc.BlockNumberOrHashWithNumber(i)
block := &Block{
Expand All @@ -1268,6 +1268,11 @@ func (r *Resolver) Blocks(ctx context.Context, args struct {
break
}
ret = append(ret, block)
select {
case <-ctx.Done():
return nil, ctx.Err()
default:
}
}
return ret, nil
}
Expand Down