peer_protocol/protocol.go | 8 ++++++++ diff --git a/peer_protocol/protocol.go b/peer_protocol/protocol.go index f1f392f9a9c414d3ebb5702b38f77db29ff85c62..19db34fb259d49cc4a09b600ab31ef3443aa0096 100644 --- a/peer_protocol/protocol.go +++ b/peer_protocol/protocol.go @@ -68,6 +68,14 @@ ExtendedPayload []byte Port uint16 } +func (msg Message) MustMarshalBinary() []byte { + b, err := msg.MarshalBinary() + if err != nil { + panic(err) + } + return b +} + func (msg Message) MarshalBinary() (data []byte, err error) { buf := &bytes.Buffer{} if !msg.Keepalive {