From ff38c9ee2ebe64abaef115af70005128d90ae405 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi <1591639+s1na@users.noreply.github.com> Date: Tue, 14 Feb 2023 16:48:22 +0300 Subject: [PATCH] eth/filters: replace atomic pointer with value (#26689) * eth/filters: replace atomic.Pointer * fix * improve Co-authored-by: Martin Holst Swende --------- Co-authored-by: Martin Holst Swende --- eth/filters/filter_system.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 42ea17d505..9fc20f335b 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -95,7 +95,7 @@ func NewFilterSystem(backend Backend, config Config) *FilterSystem { type logCacheElem struct { logs []*types.Log - body atomic.Pointer[types.Body] + body atomic.Value } // cachedLogElem loads block logs from the backend and caches the result. @@ -133,7 +133,7 @@ func (sys *FilterSystem) cachedLogElem(ctx context.Context, blockHash common.Has func (sys *FilterSystem) cachedGetBody(ctx context.Context, elem *logCacheElem, hash common.Hash, number uint64) (*types.Body, error) { if body := elem.body.Load(); body != nil { - return body, nil + return body.(*types.Body), nil } body, err := sys.backend.GetBody(ctx, hash, rpc.BlockNumber(number)) if err != nil {