1 // Copyright (c) 2013-2015 The btcsuite developers
2 // Use of this source code is governed by an ISC
3 // license that can be found in the LICENSE file.
11 // MsgGetAddr implements the Message interface and represents a bitcoin
12 // getaddr message. It is used to request a list of known active peers on the
13 // network from a peer to help identify potential nodes. The list is returned
14 // via one or more addr messages (MsgAddr).
16 // This message has no payload.
17 type MsgGetAddr struct{}
19 // BtcDecode decodes r using the bitcoin protocol encoding into the receiver.
20 // This is part of the Message interface implementation.
21 func (msg *MsgGetAddr) BtcDecode(r io.Reader, pver uint32, enc MessageEncoding) error {
25 // BtcEncode encodes the receiver to w using the bitcoin protocol encoding.
26 // This is part of the Message interface implementation.
27 func (msg *MsgGetAddr) BtcEncode(w io.Writer, pver uint32, enc MessageEncoding) error {
31 // Command returns the protocol command string for the message. This is part
32 // of the Message interface implementation.
33 func (msg *MsgGetAddr) Command() string {
37 // MaxPayloadLength returns the maximum length the payload can be for the
38 // receiver. This is part of the Message interface implementation.
39 func (msg *MsgGetAddr) MaxPayloadLength(pver uint32) uint32 {
43 // NewMsgGetAddr returns a new bitcoin getaddr message that conforms to the
44 // Message interface. See MsgGetAddr for details.
45 func NewMsgGetAddr() *MsgGetAddr {