Commit 6061eb6
MarcoFalke
Merge bitcoin/bitcoin#26199: p2p: Don't self-advertise during version processing
956c670 refactor, doc: Improve SetupAddressRelay call in version processing (Martin Zumsande)
3c43d9d p2p: Don't self-advertise during VERSION processing (Gleb Naumenko)
Pull request description:
This picks up the last commit from #19843.
Previously, we would prepare to self-announce to a new peer while parsing a `version` message from that peer.
This is redundant, because we do something very similar in `MaybeSendAddr()`, which is called from `SendMessages()` after
the version handshake is finished.
There are a couple of differences:
1) `MaybeSendAddr()` self-advertises to all peers we do address relay with, not just outbound ones.
2) `GetLocalAddrForPeer()` called from `MaybeSendAddr()` makes a probabilistic decision to either advertise what they think we are or what we think we are, while `PushAddress()` on `version` deterministically only does the former if the address from the latter is unroutable.
3) During `version` processing, we haven't received a potential sendaddrv2 message from our peer yet, so self-advertisements with addresses from addrV2-only networks would always be dropped in `PushAddress()`.
Since it's confusing to have two slightly different mechanisms for self-advertising, and the one in `MaybeSendAddr()` is better, remove the one in `version`.
ACKs for top commit:
stratospher:
ACK 956c670
naumenkogs:
ACK 956c670
amitiuttarwar:
reACK 956c670
Tree-SHA512: 933d40615289f055c022170dde7bad0ac0a1d4be377538bfe9ba64375cfeb03bcd803901591f0739ac4850c880e8475a68fd1ab0330800030ab7f19e38c002741 file changed
+14
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3303 | 3303 | | |
3304 | 3304 | | |
3305 | 3305 | | |
3306 | | - | |
3307 | | - | |
3308 | | - | |
3309 | | - | |
3310 | | - | |
3311 | | - | |
3312 | | - | |
3313 | | - | |
3314 | | - | |
3315 | | - | |
| 3306 | + | |
| 3307 | + | |
| 3308 | + | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
3316 | 3317 | | |
3317 | 3318 | | |
3318 | 3319 | | |
3319 | | - | |
3320 | | - | |
3321 | | - | |
3322 | | - | |
3323 | | - | |
3324 | | - | |
3325 | | - | |
3326 | | - | |
3327 | | - | |
3328 | | - | |
3329 | | - | |
3330 | | - | |
3331 | | - | |
3332 | | - | |
3333 | | - | |
3334 | | - | |
3335 | | - | |
3336 | | - | |
3337 | | - | |
3338 | | - | |
3339 | 3320 | | |
3340 | 3321 | | |
3341 | 3322 | | |
| |||
5342 | 5323 | | |
5343 | 5324 | | |
5344 | 5325 | | |
5345 | | - | |
5346 | | - | |
| 5326 | + | |
| 5327 | + | |
| 5328 | + | |
5347 | 5329 | | |
5348 | 5330 | | |
5349 | 5331 | | |
| |||
0 commit comments