aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/envelope.go
diff options
context:
space:
mode:
Diffstat (limited to 'whisper/envelope.go')
-rw-r--r--whisper/envelope.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/whisper/envelope.go b/whisper/envelope.go
index 8e66a7bbb..eb80098ad 100644
--- a/whisper/envelope.go
+++ b/whisper/envelope.go
@@ -16,8 +16,8 @@ const (
)
type Envelope struct {
- Expiry int32 // Whisper protocol specifies int32, really should be int64
- Ttl int32 // ^^^^^^
+ Expiry uint32 // Whisper protocol specifies int32, really should be int64
+ Ttl uint32 // ^^^^^^
Topics [][]byte
Data []byte
Nonce uint32
@@ -52,11 +52,11 @@ func (self *Envelope) Hash() Hash {
func NewEnvelope(ttl time.Duration, topics [][]byte, data *Message) *Envelope {
exp := time.Now().Add(ttl)
- return &Envelope{int32(exp.Unix()), int32(ttl.Seconds()), topics, data.Bytes(), 0, Hash{}}
+ return &Envelope{uint32(exp.Unix()), uint32(ttl.Seconds()), topics, data.Bytes(), 0, Hash{}}
}
-func (self *Envelope) Seal() {
- self.proveWork(DefaultPow)
+func (self *Envelope) Seal(pow time.Duration) {
+ self.proveWork(pow)
}
func (self *Envelope) proveWork(dura time.Duration) {