Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove duplicate code #9

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions rpc/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,6 @@ func NewBlockCache() BlockCache {
}
}

// BlockCache is a cache for storing block data
type BlockCache struct {
// cache is the underlying cache
cache *cache.Cache
// muMap is a map of block number to a mutex to prevent concurrent access to the same block
muMap sync.Map
}

func NewBlockCache() BlockCache {
return BlockCache{
cache: cache.New(5*time.Minute, 10*time.Minute),
}
}

// Backend implements the BackendI interface
type Backend struct {
ctx context.Context
Expand Down