aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/message.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-13 20:36:44 +0800
committerobscuren <geffobscura@gmail.com>2015-01-13 20:36:44 +0800
commite3cad04decbbc83a0c956850717cb0ae0b2b3eec (patch)
tree81e0f1a57344a7c0d6a2ae2f1481c2e26880d1c2 /whisper/message.go
parent1e5353824a7859d5cfa98565b5a879d5ca7e582a (diff)
downloadgo-tangerine-e3cad04decbbc83a0c956850717cb0ae0b2b3eec.tar.gz
go-tangerine-e3cad04decbbc83a0c956850717cb0ae0b2b3eec.tar.zst
go-tangerine-e3cad04decbbc83a0c956850717cb0ae0b2b3eec.zip
Fixed whisper messages
* Whisper protocol wasn't properly suppling envelope slices * Message history wasn't properly propagated * Added 'Messages' method, filtering any current envelope with the supplied filter.
Diffstat (limited to 'whisper/message.go')
-rw-r--r--whisper/message.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/whisper/message.go b/whisper/message.go
index db0110b4a..bbad8e6a3 100644
--- a/whisper/message.go
+++ b/whisper/message.go
@@ -67,7 +67,11 @@ func (self *Message) Seal(pow time.Duration, opts Opts) (*Envelope, error) {
}
}
- envelope := NewEnvelope(DefaultTtl, opts.Topics, self)
+ if opts.Ttl == 0 {
+ opts.Ttl = DefaultTtl
+ }
+
+ envelope := NewEnvelope(opts.Ttl, opts.Topics, self)
envelope.Seal(pow)
return envelope, nil