Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[net] Don't PushAddress(self) on VERSION
Previously, we would prepare to self-announce to a new peer while parsing a VERSION message from that peer. This is useless, because we do something very similar in AdvertiseLocal(), although there are a couple differences: 1) AdvertiseLocal() does this for all peers, not just outbound 2) AdvertiseLocal() always asks the peer to advertise based on what they think we are AND what we think we are (assuming it's routable), while PushAddress(self) on VERSION always does one of the two. (1) and the fact that AdvertiseLocal() is called right before actually sending out ADDR message with our address makes it fully encompassing PushAddress(self) on VERSION. Per (2), AdvertiseLocal() seems like a better version of PushAddress(self) on VERSION. Thus, it's fine to drop PushAddress(self) on VERSION.
- Loading branch information