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.
This commit is contained in:
obscuren
2015-01-13 13:36:44 +01:00
parent 1e5353824a
commit e3cad04dec
6 changed files with 58 additions and 34 deletions

View File

@@ -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