forked from cerc-io/plugeth
all: use github.com/deckarep/golang-set/v2 (generic set) (#26159)
Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
co-authored by
Felix Lange
parent
8c5ce1107b
commit
f58ebd9696
@@ -24,7 +24,7 @@ import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
mapset "github.com/deckarep/golang-set"
|
||||
mapset "github.com/deckarep/golang-set/v2"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/mclock"
|
||||
"github.com/ethereum/go-ethereum/core/txpool"
|
||||
@@ -148,7 +148,7 @@ type TxFetcher struct {
|
||||
drop chan *txDrop
|
||||
quit chan struct{}
|
||||
|
||||
underpriced mapset.Set // Transactions discarded as too cheap (don't re-fetch)
|
||||
underpriced mapset.Set[common.Hash] // Transactions discarded as too cheap (don't re-fetch)
|
||||
|
||||
// Stage 1: Waiting lists for newly discovered transactions that might be
|
||||
// broadcast without needing explicit request/reply round trips.
|
||||
@@ -202,7 +202,7 @@ func NewTxFetcherForTests(
|
||||
fetching: make(map[common.Hash]string),
|
||||
requests: make(map[string]*txRequest),
|
||||
alternates: make(map[common.Hash]map[string]struct{}),
|
||||
underpriced: mapset.NewSet(),
|
||||
underpriced: mapset.NewSet[common.Hash](),
|
||||
hasTx: hasTx,
|
||||
addTxs: addTxs,
|
||||
fetchTxs: fetchTxs,
|
||||
|
||||
@@ -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](),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user