whisper/whisperv6: gofmt -w -s envelope.go

This commit is contained in:
Felix Lange 2017-12-07 16:31:11 +01:00
parent 8315701538
commit 35297a8056

View file

@ -36,12 +36,12 @@ import (
// Envelope represents a clear-text data packet to transmit through the Whisper // Envelope represents a clear-text data packet to transmit through the Whisper
// network. Its contents may or may not be encrypted and signed. // network. Its contents may or may not be encrypted and signed.
type Envelope struct { type Envelope struct {
Version []byte Version []byte
Expiry uint32 Expiry uint32
TTL uint32 TTL uint32
Topic TopicType Topic TopicType
Data []byte Data []byte
Nonce uint64 Nonce uint64
pow float64 // Message-specific PoW as described in the Whisper specification. pow float64 // Message-specific PoW as described in the Whisper specification.
hash common.Hash // Cached hash of the envelope to avoid rehashing every time. hash common.Hash // Cached hash of the envelope to avoid rehashing every time.
@ -63,12 +63,12 @@ func (e *Envelope) rlpWithoutNonce() []byte {
// included into an envelope for network forwarding. // included into an envelope for network forwarding.
func NewEnvelope(ttl uint32, topic TopicType, msg *sentMessage) *Envelope { func NewEnvelope(ttl uint32, topic TopicType, msg *sentMessage) *Envelope {
env := Envelope{ env := Envelope{
Version: make([]byte, 1), Version: make([]byte, 1),
Expiry: uint32(time.Now().Add(time.Second * time.Duration(ttl)).Unix()), Expiry: uint32(time.Now().Add(time.Second * time.Duration(ttl)).Unix()),
TTL: ttl, TTL: ttl,
Topic: topic, Topic: topic,
Data: msg.Raw, Data: msg.Raw,
Nonce: 0, Nonce: 0,
} }
if EnvelopeVersion < 256 { if EnvelopeVersion < 256 {