summaryrefslogtreecommitdiff
path: root/b4/aeda8c3f30dae0c7ad68a8d0110b58150db50f
blob: ab4985137f33ce4dc993016ff124e485275ff86d (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192]
	helo=mx.sourceforge.net)
	by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <matthieu@blockcypher.com>) id 1Waqbe-0005ys-Pu
	for bitcoin-development@lists.sourceforge.net;
	Thu, 17 Apr 2014 18:00:14 +0000
X-ACL-Warn: 
Received: from mail-la0-f48.google.com ([209.85.215.48])
	by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128)
	(Exim 4.76) id 1Waqbb-0003uq-Hc
	for bitcoin-development@lists.sourceforge.net;
	Thu, 17 Apr 2014 18:00:14 +0000
Received: by mail-la0-f48.google.com with SMTP id gf5so646931lab.21
	for <bitcoin-development@lists.sourceforge.net>;
	Thu, 17 Apr 2014 11:00:04 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:cc:content-type;
	bh=d6Z7OqMi36i2fc/dERUtHM7cRr5+KKNo5poIDYv5jrY=;
	b=RCMrqAaZ7YnA+LTXWtKNpflXDynidNjbyFZYqpCZNYE3OV6qzVsRIitIQETD4ibADG
	UlSW6klxymqCm2Qdt0RkKml9PnYQlhxNDIaHiACGyQPjkRE4vBZyzonatd3yZflm7iQC
	pwLwKUuKp9Y/if/hMOrcQ9nS38JZkR4OYjwjthiNzBeN2S+2iIpyJpnqZD0iWv8fQPLb
	AdRQnsNGYBSd60/MVqLy9gX89x3ISaV6LFd3oA1a+apLg07umsZXTQMXGbmKB48eZ4g3
	jHVeJIizNp0/baSHl4Blfr/ZtMZn8BanLwmvIzh0egoA2F3TdHH7m+mIPwKldZVBRwA9
	B6eA==
X-Gm-Message-State: ALoCoQmykYENTL18HcOTj+MRjG/EBBrNSWgv+PeRnitiTyZpy2ahp90bISXYEqOvrJFiOvy00KaP
MIME-Version: 1.0
X-Received: by 10.112.131.65 with SMTP id ok1mr2106693lbb.51.1397757604868;
	Thu, 17 Apr 2014 11:00:04 -0700 (PDT)
Received: by 10.112.161.67 with HTTP; Thu, 17 Apr 2014 11:00:04 -0700 (PDT)
X-Originating-IP: [173.228.17.216]
In-Reply-To: <534FA237.1010501@cs.huji.ac.il>
References: <534FA237.1010501@cs.huji.ac.il>
Date: Thu, 17 Apr 2014 11:00:04 -0700
Message-ID: <CAHUNwMoSG+C8T4_69j3-qmM_Z=WYixARYuAr1CEUv6Wxq6kajA@mail.gmail.com>
From: Matthieu Riou <matthieu@blockcypher.com>
To: Sharon Dvir <sharondvir@cs.huji.ac.il>
Content-Type: multipart/alternative; boundary=047d7b3439e48548d504f740cdcc
X-Spam-Score: 1.0 (+)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
	See http://spamassassin.org/tag/ for more details.
	1.0 HTML_MESSAGE           BODY: HTML included in message
X-Headers-End: 1Waqbb-0003uq-Hc
Cc: bitcoin-development@lists.sourceforge.net
Subject: Re: [Bitcoin-development] question about ProcessMessage()
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, 17 Apr 2014 18:00:14 -0000

--047d7b3439e48548d504f740cdcc
Content-Type: text/plain; charset=ISO-8859-1

Github has a nice feature that lets you link to a specific line of code:

https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L3549

Is it the line you're referring to? It just flags the peer as at that point
we know we don't have more addresses to learn from it (peers send 1000
addrs). The previous
check<https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L3497>only
applies for peers sending an addr message that would have more than
1000 addresses, which is disallowed to prevent flooding. And no number is
both greater and lesser than 1000 :)

Matthieu


On Thu, Apr 17, 2014 at 2:43 AM, Sharon Dvir <sharondvir@cs.huji.ac.il>wrote:

> Hi, in main.cpp, ProcessMessage(), the line:
> if (vAddr.size() < 1000) that appears at about line 3290
> (not sure which, as I have made changes.)
> What is the purpose of this line?
> vAddr.size() was already checked at about line 3240, and if it was >
> 1000, the function has returned.
> Is pfrom->fGetAddr allowed to be true iff  vAddr.size()==1000 ?
> Could not find it in list archive.
> Thanks.
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>

--047d7b3439e48548d504f740cdcc
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Github has a nice feature that lets you link to a specific=
 line of code:<div><br></div><div><a href=3D"https://github.com/bitcoin/bit=
coin/blob/master/src/main.cpp#L3549">https://github.com/bitcoin/bitcoin/blo=
b/master/src/main.cpp#L3549</a><br>
</div><div><br></div><div>Is it the line you&#39;re referring to? It just f=
lags the peer as at that point we know we don&#39;t have more addresses to =
learn from it (peers send 1000 addrs). The <a href=3D"https://github.com/bi=
tcoin/bitcoin/blob/master/src/main.cpp#L3497">previous check</a> only appli=
es for peers sending an addr message that would have more than 1000 address=
es, which is disallowed to prevent flooding. And no number is both greater =
and lesser than 1000 :)</div>
<div><br></div><div>Matthieu</div></div><div class=3D"gmail_extra"><br><br>=
<div class=3D"gmail_quote">On Thu, Apr 17, 2014 at 2:43 AM, Sharon Dvir <sp=
an dir=3D"ltr">&lt;<a href=3D"mailto:sharondvir@cs.huji.ac.il" target=3D"_b=
lank">sharondvir@cs.huji.ac.il</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Hi, in main.cpp, ProcessMessage(), the line:=
<br>
if (vAddr.size() &lt; 1000) that appears at about line 3290<br>
(not sure which, as I have made changes.)<br>
What is the purpose of this line?<br>
vAddr.size() was already checked at about line 3240, and if it was &gt;<br>
1000, the function has returned.<br>
Is pfrom-&gt;fGetAddr allowed to be true iff =A0vAddr.size()=3D=3D1000 ?<br=
>
Could not find it in list archive.<br>
Thanks.<br>
<br>
---------------------------------------------------------------------------=
---<br>
Learn Graph Databases - Download FREE O&#39;Reilly Book<br>
&quot;Graph Databases&quot; is the definitive new guide to graph databases =
and their<br>
applications. Written by three acclaimed leaders in the field,<br>
this first edition is now available. Download your free book today!<br>
<a href=3D"http://p.sf.net/sfu/NeoTech" target=3D"_blank">http://p.sf.net/s=
fu/NeoTech</a><br>
_______________________________________________<br>
Bitcoin-development mailing list<br>
<a href=3D"mailto:Bitcoin-development@lists.sourceforge.net">Bitcoin-develo=
pment@lists.sourceforge.net</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/bitcoin-development=
" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/bitcoin-de=
velopment</a><br>
</blockquote></div><br></div>

--047d7b3439e48548d504f740cdcc--