code: func writeNetAddress(w io.Writer, pver uint32, na *NetAddress, ts bool) error {
  	// NOTE: The bitcoin protocol uses a uint32 for the timestamp so it will
  	// stop working somewhere around 2106.  Also timestamp wasn't added until
  	// until protocol version >= NetAddressTimeVersion.
  	if ts && pver >= NetAddressTimeVersion {
  		err := writeElement(w, uint32(na.Timestamp.Unix()))
  		if err != nil {
  			return err
  		}
  	}
  
  	// Ensure to always write 16 bytes even if the ip is nil.
  	var ip [16]byte
  	if na.IP != nil {
  		copy(ip[:], na.IP.To16())
  	}
  	err := writeElements(w, na.Services, ip)
  	if err != nil {
  		return err
  	}
  
  	// Sigh.  Bitcoin protocol mixes little and big endian.
  	return binary.Write(w, bigEndian, na.Port)
  }
docs: // writeNetAddress serializes a NetAddress to w depending on the protocol
  // version and whether or not the timestamp is included per ts.  Some messages
  // like version do not include the timestamp.