aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisperv6/whisper.go
diff options
context:
space:
mode:
Diffstat (limited to 'whisper/whisperv6/whisper.go')
-rw-r--r--whisper/whisperv6/whisper.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/whisper/whisperv6/whisper.go b/whisper/whisperv6/whisper.go
index 3418c7bf7..76d485808 100644
--- a/whisper/whisperv6/whisper.go
+++ b/whisper/whisperv6/whisper.go
@@ -26,6 +26,7 @@ import (
"sync"
"time"
+ mapset "github.com/deckarep/golang-set"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
@@ -35,7 +36,6 @@ import (
"github.com/syndtr/goleveldb/leveldb/errors"
"golang.org/x/crypto/pbkdf2"
"golang.org/x/sync/syncmap"
- set "gopkg.in/fatih/set.v0"
)
// Statistics holds several message-related counter for analytics
@@ -69,7 +69,7 @@ type Whisper struct {
poolMu sync.RWMutex // Mutex to sync the message and expiration pools
envelopes map[common.Hash]*Envelope // Pool of envelopes currently tracked by this node
- expirations map[uint32]*set.SetNonTS // Message expiration pool
+ expirations map[uint32]mapset.Set // Message expiration pool
peerMu sync.RWMutex // Mutex to sync the active peer set
peers map[*Peer]struct{} // Set of currently active peers
@@ -100,7 +100,7 @@ func New(cfg *Config) *Whisper {
privateKeys: make(map[string]*ecdsa.PrivateKey),
symKeys: make(map[string][]byte),
envelopes: make(map[common.Hash]*Envelope),
- expirations: make(map[uint32]*set.SetNonTS),
+ expirations: make(map[uint32]mapset.Set),
peers: make(map[*Peer]struct{}),
messageQueue: make(chan *Envelope, messageQueueLimit),
p2pMsgQueue: make(chan *Envelope, messageQueueLimit),
@@ -796,9 +796,9 @@ func (whisper *Whisper) add(envelope *Envelope, isP2P bool) (bool, error) {
if !alreadyCached {
whisper.envelopes[hash] = envelope
if whisper.expirations[envelope.Expiry] == nil {
- whisper.expirations[envelope.Expiry] = set.NewNonTS()
+ whisper.expirations[envelope.Expiry] = mapset.NewThreadUnsafeSet()
}
- if !whisper.expirations[envelope.Expiry].Has(hash) {
+ if !whisper.expirations[envelope.Expiry].Contains(hash) {
whisper.expirations[envelope.Expiry].Add(hash)
}
}