On Thu, Jun 20, 2013 at 3:13 AM, Addy Yeow <ayeo...@gmail.com> wrote:
> I personally don't treat the relay field as optional, i.e. it is there as
> 0x01 if it is set. Otherwise, it is simply a trailing zero byte. Hence, the
> right way of reading the packet as with any network packet is to first
> retrieve the header information, get the actual payload length, then parse
> the payload accordingly. I can also choose to include 0x00 for my relay
> field in my outgoing packet and reflect that accordingly in my length field
> in the header.

That works until another field is added in the same manner.

Implementations are expected to follow the standard logic of

if (more data)
   parse field X
if (more data)
   parse field X+1
if (more data)
   parse field X+2
etc.

Ugly or not, there is no point in changing now.  Updating the version
message to a radically different design, for simply cleanliness
reasons, is not sufficient cause to migrate the entire bitcoin
universe to a new and different version/feature negotiation setup.

--
Jeff Garzik
Senior Software Engineer and open source evangelist
BitPay, Inc.      https://bitpay.com/

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development

Reply via email to