Skip to content

Commit ff38c9e

Browse files
s1naholiman
andauthored
eth/filters: replace atomic pointer with value (#26689)
* eth/filters: replace atomic.Pointer * fix * improve Co-authored-by: Martin Holst Swende <[email protected]> --------- Co-authored-by: Martin Holst Swende <[email protected]>
1 parent f44ebc4 commit ff38c9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eth/filters/filter_system.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func NewFilterSystem(backend Backend, config Config) *FilterSystem {
9595

9696
type logCacheElem struct {
9797
logs []*types.Log
98-
body atomic.Pointer[types.Body]
98+
body atomic.Value
9999
}
100100

101101
// 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
133133

134134
func (sys *FilterSystem) cachedGetBody(ctx context.Context, elem *logCacheElem, hash common.Hash, number uint64) (*types.Body, error) {
135135
if body := elem.body.Load(); body != nil {
136-
return body, nil
136+
return body.(*types.Body), nil
137137
}
138138
body, err := sys.backend.GetBody(ctx, hash, rpc.BlockNumber(number))
139139
if err != nil {

0 commit comments

Comments
 (0)