forked from gcash/bchd
/
msgxversion.go
48 lines (40 loc) · 1.51 KB
/
msgxversion.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) 2019 The bchd developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package wire
import (
"io"
)
// MsgXVersion implements the Message interface and represents a bitcoin xversion
// message. This is a stub used to support BU clients.
type MsgXVersion struct {
}
// BchDecode decodes r using the bitcoin protocol encoding into the receiver.
//
// This is part of the Message interface implementation.
func (msg *MsgXVersion) BchDecode(r io.Reader, pver uint32, enc MessageEncoding) error {
return nil
}
// BchEncode encodes the receiver to w using the bitcoin protocol encoding.
// This is part of the Message interface implementation.
func (msg *MsgXVersion) BchEncode(w io.Writer, pver uint32, enc MessageEncoding) error {
return nil
}
// Command returns the protocol command string for the message. This is part
// of the Message interface implementation.
func (msg *MsgXVersion) Command() string {
return CmdXVersion
}
// MaxPayloadLength returns the maximum length the payload can be for the
// receiver. This is part of the Message interface implementation.
func (msg *MsgXVersion) MaxPayloadLength(pver uint32) uint32 {
// May payload size for xversion messages is defined as
// 100000 in the spec.
return 100000
}
// NewMsgXVersion returns a new bitcoin xversion message that conforms to the
// Message interface using the passed parameters and defaults for the remaining
// fields.
func NewMsgXVersion() *MsgXVersion {
return &MsgXVersion{}
}