1 package wire
2 3 import (
4 "io"
5 )
6 7 // MsgGetAddr implements the Message interface and represents a bitcoin getaddr message. It is used to request a list of
8 // known active peers on the network from a peer to help identify potential nodes. The list is returned via one or more
9 // addr messages (MsgAddr). This message has no payload.
10 type MsgGetAddr struct{}
11 12 // BtcDecode decodes r using the bitcoin protocol encoding into the receiver. This is part of the Message interface
13 // implementation.
14 func (msg *MsgGetAddr) BtcDecode(r io.Reader, pver uint32, enc MessageEncoding) (e error) {
15 return nil
16 }
17 18 // BtcEncode encodes the receiver to w using the bitcoin protocol encoding. This is part of the Message interface
19 // implementation.
20 func (msg *MsgGetAddr) BtcEncode(w io.Writer, pver uint32, enc MessageEncoding) (e error) {
21 return nil
22 }
23 24 // Command returns the protocol command string for the message. This is part of the Message interface implementation.
25 func (msg *MsgGetAddr) Command() string {
26 return CmdGetAddr
27 }
28 29 // MaxPayloadLength returns the maximum length the payload can be for the receiver. This is part of the Message
30 // interface implementation.
31 func (msg *MsgGetAddr) MaxPayloadLength(pver uint32) uint32 {
32 return 0
33 }
34 35 // NewMsgGetAddr returns a new bitcoin getaddr message that conforms to the Message interface. See MsgGetAddr for
36 // details.
37 func NewMsgGetAddr() *MsgGetAddr {
38 return &MsgGetAddr{}
39 }
40