aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisper.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-04-15 19:28:46 +0800
committerFelix Lange <fjl@twurst.com>2016-04-15 19:28:46 +0800
commit3a5bdef962ece873791ab838480892fd75110af1 (patch)
tree8bd84be7b7b0051d918ec229f8a3de6a0397dd2b /whisper/whisper.go
parentfdc5a7dc1a1764c63190a649f70296cbdbc0abe1 (diff)
downloaddexon-3a5bdef962ece873791ab838480892fd75110af1.tar
dexon-3a5bdef962ece873791ab838480892fd75110af1.tar.gz
dexon-3a5bdef962ece873791ab838480892fd75110af1.tar.bz2
dexon-3a5bdef962ece873791ab838480892fd75110af1.tar.lz
dexon-3a5bdef962ece873791ab838480892fd75110af1.tar.xz
dexon-3a5bdef962ece873791ab838480892fd75110af1.tar.zst
dexon-3a5bdef962ece873791ab838480892fd75110af1.zip
whisper: deflake Test*MessageExpiration
These tests have become a common annoyance on CI. Fix them by allowing messages with expiration == now into the cache and delaying the check for expired message handling slightly.
Diffstat (limited to 'whisper/whisper.go')
-rw-r--r--whisper/whisper.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/whisper/whisper.go b/whisper/whisper.go
index e5f686e43..0a49c1000 100644
--- a/whisper/whisper.go
+++ b/whisper/whisper.go
@@ -255,7 +255,7 @@ func (self *Whisper) add(envelope *Envelope) error {
defer self.poolMu.Unlock()
// short circuit when a received envelope has already expired
- if envelope.Expiry <= uint32(time.Now().Unix()) {
+ if envelope.Expiry < uint32(time.Now().Unix()) {
return nil
}
@@ -278,7 +278,6 @@ func (self *Whisper) add(envelope *Envelope) error {
go self.postEvent(envelope)
}
glog.V(logger.Detail).Infof("cached whisper envelope %x\n", envelope)
-
return nil
}