diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-08 19:43:33 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-08 19:43:33 +0800 |
commit | ebe2d9d872c5482e02508f1d3e9c3a56e8a41d44 (patch) | |
tree | c26c4e780226851bc699ca182bcb2f4d5da3dc0e /whisper/message.go | |
parent | f06543fd066e11ac5c36f3eba4f1f82a7a1aefb8 (diff) | |
download | go-tangerine-ebe2d9d872c5482e02508f1d3e9c3a56e8a41d44.tar.gz go-tangerine-ebe2d9d872c5482e02508f1d3e9c3a56e8a41d44.tar.zst go-tangerine-ebe2d9d872c5482e02508f1d3e9c3a56e8a41d44.zip |
First draft of Whisper messages relaying
Diffstat (limited to 'whisper/message.go')
-rw-r--r-- | whisper/message.go | 15 |
1 files changed, 15 insertions, 0 deletions
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...)...) +} |