From ebe2d9d872c5482e02508f1d3e9c3a56e8a41d44 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 8 Dec 2014 12:43:33 +0100 Subject: First draft of Whisper messages relaying --- whisper/message.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 whisper/message.go (limited to 'whisper/message.go') diff --git a/whisper/message.go b/whisper/message.go new file mode 100644 index 000000000..21cf163e6 --- /dev/null +++ b/whisper/message.go @@ -0,0 +1,15 @@ +package whisper + +type Message struct { + Flags byte + Signature []byte + Payload []byte +} + +func NewMessage(payload []byte) *Message { + return &Message{Flags: 0, Payload: payload} +} + +func (self *Message) Bytes() []byte { + return append([]byte{self.Flags}, append(self.Signature, self.Payload...)...) +} -- cgit