aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisper.go
diff options
context:
space:
mode:
Diffstat (limited to 'whisper/whisper.go')
-rw-r--r--whisper/whisper.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/whisper/whisper.go b/whisper/whisper.go
index 676d8ae7a..a341f23e4 100644
--- a/whisper/whisper.go
+++ b/whisper/whisper.go
@@ -234,6 +234,11 @@ func (self *Whisper) add(envelope *Envelope) error {
self.poolMu.Lock()
defer self.poolMu.Unlock()
+ // short circuit when a received envelope has already expired
+ if envelope.Expiry <= uint32(time.Now().Unix()) {
+ return nil
+ }
+
// Insert the message into the tracked pool
hash := envelope.Hash()
if _, ok := self.messages[hash]; ok {