First draft of Whisper messages relaying
This commit is contained in:
15
whisper/message.go
Normal file
15
whisper/message.go
Normal file
@ -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...)...)
|
||||
}
|
Reference in New Issue
Block a user