all: use github.com/deckarep/golang-set/v2 (generic set) (#26159)

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
Jolly Zhao
2022-11-14 15:16:52 +01:00
committed by GitHub
co-authored by Felix Lange
parent 8c5ce1107b
commit f58ebd9696
10 changed files with 71 additions and 42 deletions
+3 -3
View File
@@ -21,7 +21,7 @@ import (
"math/rand"
"sync"
mapset "github.com/deckarep/golang-set"
mapset "github.com/deckarep/golang-set/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/p2p"
@@ -502,7 +502,7 @@ func (p *Peer) RequestTxs(hashes []common.Hash) error {
// knownCache is a cache for known hashes.
type knownCache struct {
hashes mapset.Set
hashes mapset.Set[common.Hash]
max int
}
@@ -510,7 +510,7 @@ type knownCache struct {
func newKnownCache(max int) *knownCache {
return &knownCache{
max: max,
hashes: mapset.NewSet(),
hashes: mapset.NewSet[common.Hash](),
}
}