Skip to content

Commit

Permalink
Fix data race
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkushinDaniil committed Jan 8, 2025
1 parent 2653ae9 commit 6e2a241
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rpc/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,11 @@ func (h *Handler) Run(ctx context.Context) error {
feed.Tee(l1HeadsSub, h.l1Heads)

<-ctx.Done()
h.mu.Lock()
for _, sub := range h.subscriptions {
sub.wg.Wait()
}
h.mu.Unlock()
return nil
}

Expand Down

0 comments on commit 6e2a241

Please sign in to comment.