From 6e2a24169f1c51f4e57e3ca4533bfa92fbe87ddb Mon Sep 17 00:00:00 2001 From: AnkushinDaniil Date: Wed, 8 Jan 2025 19:08:42 +0900 Subject: [PATCH] Fix data race --- rpc/handlers.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpc/handlers.go b/rpc/handlers.go index 310776599d..ce4560c3e8 100644 --- a/rpc/handlers.go +++ b/rpc/handlers.go @@ -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 }