From e7fa158086987045bdd3886107fb2c5a8b05f033 Mon Sep 17 00:00:00 2001 From: ucwong Date: Mon, 8 Jan 2024 19:18:30 +0000 Subject: [PATCH] eth/filters: fix early Unsubscribe of log events (#28769) --- eth/filters/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/filters/api.go b/eth/filters/api.go index 5dc59d01c..8cf701ec5 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -266,9 +266,9 @@ func (api *FilterAPI) Logs(ctx context.Context, crit FilterCriteria) (*rpc.Subsc if err != nil { return nil, err } - defer logsSub.Unsubscribe() go func() { + defer logsSub.Unsubscribe() for { select { case logs := <-matchedLogs: