summaryrefslogtreecommitdiff
path: root/c4/e44fcd4fc21c5bab6d0b4a0a241e8c68f4df0c
blob: f46f2b71a3cb6a05b8423aace9f7f9bd6a5199e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194]
	helo=mx.sourceforge.net)
	by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <jgarzik@bitpay.com>) id 1UpfMh-0008Ug-Sv
	for bitcoin-development@lists.sourceforge.net;
	Thu, 20 Jun 2013 13:57:31 +0000
Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of bitpay.com
	designates 209.85.212.180 as permitted sender)
	client-ip=209.85.212.180; envelope-from=jgarzik@bitpay.com;
	helo=mail-wi0-f180.google.com; 
Received: from mail-wi0-f180.google.com ([209.85.212.180])
	by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128)
	(Exim 4.76) id 1UpfMg-0005Wx-21
	for bitcoin-development@lists.sourceforge.net;
	Thu, 20 Jun 2013 13:57:31 +0000
Received: by mail-wi0-f180.google.com with SMTP id c10so1728837wiw.7
	for <bitcoin-development@lists.sourceforge.net>;
	Thu, 20 Jun 2013 06:57:23 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=92t3jWXgymMt9kvF44h67I/MP60d83yF9dRgjbvpOGQ=;
	b=Q+SacKTFLqQaMoeD/5C4a891RnpO89YLzmjOhvM27Wg54K3zqgYUwDhr7Ls3EcGcJr
	iihzD5hYAnbi3ghFHTefzIIXLbf3mxj21IEWWXufmaJPS6h/IIGMNLxmpAzJir8TVn2/
	PrmNQa9nkOKC0xuyCoFDFNxgDgFJkSf7/gcGVXMki88GxO3xabGX3SnfWsNejA1V0W0D
	gcnFQv5aXUyj2Tzo6juZ5/83fril17zPCgMXCBo5YhDqoHKDnXyLJEenDas1hCIc9pGi
	1LMgkFbd1O+F1txulR61Ty1pXKkNuuYYyIkTPi+JnXFqD4t81rC2lev9rluwc70lGJ3y
	B3nw==
MIME-Version: 1.0
X-Received: by 10.180.102.37 with SMTP id fl5mr14473891wib.52.1371735311253;
	Thu, 20 Jun 2013 06:35:11 -0700 (PDT)
Received: by 10.194.178.69 with HTTP; Thu, 20 Jun 2013 06:35:11 -0700 (PDT)
In-Reply-To: <CAA3bHnzrRijieFi5phXZfuHEU3eLrPcVJwXuPpUrepWCY7coQQ@mail.gmail.com>
References: <BLU404-EAS74077C5D43EACD319CCA3DA58D0@phx.gbl>
	<CANEZrP0Pr=_L7CA4hdt9esVCHqf-EOjfDjnVrw8rFxL1OtUw7A@mail.gmail.com>
	<1371709237.57104.YahooMailNeo@web162701.mail.bf1.yahoo.com>
	<CAA3bHnzrRijieFi5phXZfuHEU3eLrPcVJwXuPpUrepWCY7coQQ@mail.gmail.com>
Date: Thu, 20 Jun 2013 09:35:11 -0400
Message-ID: <CAJHLa0MrG3wkfQMRoeTp5nOwAcpLOVKd+c96NozTz=w3-0g4Jg@mail.gmail.com>
From: Jeff Garzik <jgarzik@bitpay.com>
To: Addy Yeow <ayeowch@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
X-Gm-Message-State: ALoCoQm3u0NKxoixYe/YiBUwTPnV/qGvPHUujZZ0TJMF1ejv+dxERVhTvbS1nWLlhoiY4iHR7gev
X-Spam-Score: -1.6 (-)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
	See http://spamassassin.org/tag/ for more details.
	-1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for
	sender-domain
	-0.0 SPF_PASS               SPF: sender matches SPF record
	-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
	author's domain
	0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
	not necessarily valid
	-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
X-Headers-End: 1UpfMg-0005Wx-21
Cc: "bitcoin-development@lists.sourceforge.net"
	<bitcoin-development@lists.sourceforge.net>
Subject: Re: [Bitcoin-development] Missing fRelayTxes in version message
X-BeenThere: bitcoin-development@lists.sourceforge.net
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Thu, 20 Jun 2013 13:57:32 -0000

On Thu, Jun 20, 2013 at 3:13 AM, Addy Yeow <ayeowch@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/