diff options
author | Javier Peletier <jm@epiclabs.io> | 2018-03-05 23:00:03 +0800 |
---|---|---|
committer | Javier Peletier <jm@epiclabs.io> | 2018-03-05 23:00:03 +0800 |
commit | 13b566e06e9aae28bddde431c7d53a335272411a (patch) | |
tree | b649ab64ca2c00327500aed5c826d5a6f454a6cf /whisper/whisperv5 | |
parent | 1e72271f571f916691c5c18b8f0c4c5f7e0445c3 (diff) | |
parent | 1548518644071c8fa8eb98a8cb8a8c4603400acb (diff) | |
download | dexon-13b566e06e9aae28bddde431c7d53a335272411a.tar dexon-13b566e06e9aae28bddde431c7d53a335272411a.tar.gz dexon-13b566e06e9aae28bddde431c7d53a335272411a.tar.bz2 dexon-13b566e06e9aae28bddde431c7d53a335272411a.tar.lz dexon-13b566e06e9aae28bddde431c7d53a335272411a.tar.xz dexon-13b566e06e9aae28bddde431c7d53a335272411a.tar.zst dexon-13b566e06e9aae28bddde431c7d53a335272411a.zip |
accounts/abi: Add one-parameter event test case from enriquefynn/unpack_one_arg_event
Diffstat (limited to 'whisper/whisperv5')
-rw-r--r-- | whisper/whisperv5/api.go | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/whisper/whisperv5/api.go b/whisper/whisperv5/api.go index b4494d0d6..ee566625c 100644 --- a/whisper/whisperv5/api.go +++ b/whisper/whisperv5/api.go @@ -60,32 +60,9 @@ func NewPublicWhisperAPI(w *Whisper) *PublicWhisperAPI { w: w, lastUsed: make(map[string]time.Time), } - - go api.run() return api } -// run the api event loop. -// this loop deletes filter that have not been used within filterTimeout -func (api *PublicWhisperAPI) run() { - timeout := time.NewTicker(2 * time.Minute) - for { - <-timeout.C - - api.mu.Lock() - for id, lastUsed := range api.lastUsed { - if time.Since(lastUsed).Seconds() >= filterTimeout { - delete(api.lastUsed, id) - if err := api.w.Unsubscribe(id); err != nil { - log.Error("could not unsubscribe whisper filter", "error", err) - } - log.Debug("delete whisper filter (timeout)", "id", id) - } - } - api.mu.Unlock() - } -} - // Version returns the Whisper sub-protocol version. func (api *PublicWhisperAPI) Version(ctx context.Context) string { return ProtocolVersionStr |