Commit ab6da24
committed
Request more p2p addrs after peer checks
If the height or required services is deemed insufficient after the connection
handshake, do not request more addresses right away, waiting for its response
before killing the TCP connection. This stops ConnectOutbound from returning
early with error while the TCP connection is still active, and causing the SPV
syncer to begin connecting to more remote peers. While the SPV syncer remains
limited to 8 total outbound managed peers, the total count of TCP connections
can easily exceed this, and has been observed to max out the circuit limit on
Tor proxies.
Although this appears to move the address requesting to the foreground of
ConnectOutbound, it only writes the getaddr message. addr message replies are
handled internally by the RemotePeer.1 parent 3f77f1b commit ab6da24
1 file changed
+13
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | 259 | | |
270 | 260 | | |
271 | 261 | | |
272 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
273 | 266 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
| 267 | + | |
282 | 268 | | |
283 | 269 | | |
284 | 270 | | |
| |||
288 | 274 | | |
289 | 275 | | |
290 | 276 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
| 277 | + | |
297 | 278 | | |
298 | 279 | | |
299 | 280 | | |
300 | 281 | | |
301 | 282 | | |
302 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
303 | 292 | | |
304 | 293 | | |
305 | 294 | | |
| |||
0 commit comments