code: func (msg *MsgGetBlocks) BtcEncode(w io.Writer, pver uint32, enc MessageEncoding) error {
  	count := len(msg.BlockLocatorHashes)
  	if count > MaxBlockLocatorsPerMsg {
  		str := fmt.Sprintf("too many block locator hashes for message "+
  			"[count %v, max %v]", count, MaxBlockLocatorsPerMsg)
  		return messageError("MsgGetBlocks.BtcEncode", str)
  	}
  
  	err := writeElement(w, msg.ProtocolVersion)
  	if err != nil {
  		return err
  	}
  
  	err = WriteVarInt(w, pver, uint64(count))
  	if err != nil {
  		return err
  	}
  
  	for _, hash := range msg.BlockLocatorHashes {
  		err = writeElement(w, hash)
  		if err != nil {
  			return err
  		}
  	}
  
  	return writeElement(w, &msg.HashStop)
  }
docs: // BtcEncode encodes the receiver to w using the bitcoin protocol encoding.
  // This is part of the Message interface implementation.