Skip to content

Commit

Permalink
eth/filters: replace atomic pointer with value (ethereum#26689)
Browse files Browse the repository at this point in the history
* eth/filters: replace atomic.Pointer

* fix

* improve

Co-authored-by: Martin Holst Swende <[email protected]>

---------

Co-authored-by: Martin Holst Swende <[email protected]>
  • Loading branch information
2 people authored and shekhirin committed Jun 6, 2023
1 parent 66948bf commit ac9a8e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eth/filters/filter_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ac9a8e7

Please sign in to comment.