whisper: clean up and integrate topics

This commit is contained in:
Péter Szilágyi
2015-04-13 12:16:51 +03:00
parent 7b501906db
commit 9a53390f49
7 changed files with 85 additions and 43 deletions

View File

@ -19,7 +19,7 @@ import (
type Envelope struct {
Expiry uint32 // Whisper protocol specifies int32, really should be int64
TTL uint32 // ^^^^^^
Topics [][]byte
Topics []Topic
Data []byte
Nonce uint32
@ -28,7 +28,7 @@ type Envelope struct {
// NewEnvelope wraps a Whisper message with expiration and destination data
// included into an envelope for network forwarding.
func NewEnvelope(ttl time.Duration, topics [][]byte, msg *Message) *Envelope {
func NewEnvelope(ttl time.Duration, topics []Topic, msg *Message) *Envelope {
return &Envelope{
Expiry: uint32(time.Now().Add(ttl).Unix()),
TTL: uint32(ttl.Seconds()),