github.com/dashpay/godash@v0.0.0-20160726055534-e038a21e0e3d/wire/msggetaddr.go (about)

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