Skip to content

Commit

Permalink
Return error, fix liveHeadersC forward
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoloch committed Oct 15, 2024
1 parent 0fcd4df commit e2755fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions blockchain/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (c *Client) ListenEvents(
return err
}

return forwardHeaders(ctx, histHeadersC, headersC)
return forwardHeaders(ctx, liveHeadersC, headersC)
})

// Retrieve events skipping blocks before 'begin'.
Expand Down Expand Up @@ -215,11 +215,11 @@ func (c *Client) ListenEvents(
return g.Wait()
}

func forwardHeaders(ctx context.Context, from, to chan types.Header) error {
func forwardHeaders(ctx context.Context, from <-chan types.Header, to chan types.Header) error {
for {
select {
case <-ctx.Done():
return nil
return ctx.Err()
case header, ok := <-from:
if !ok {
return context.Canceled
Expand Down

0 comments on commit e2755fd

Please sign in to comment.