mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 04:57:17 +00:00
16 lines
304 B
Go
16 lines
304 B
Go
|
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...)...)
|
||
|
}
|