Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about addr handling #1709

Closed
amitiuttarwar opened this issue Apr 15, 2021 · 2 comments
Closed

Question about addr handling #1709

amitiuttarwar opened this issue Apr 15, 2021 · 2 comments

Comments

@amitiuttarwar
Copy link

Hi! I'm proposing some changes to addr handling in Bitcoin Core, and trying to ensure there will not be negative consequences for other clients on the network. For more information about the changes, please see my mailing list post. The crux is that, if the changes are accepted, bitcoin core would stop sending addr messages to peers who don't "indicate interest" aka initiate an addr-related message (addr, addrv2, getaddr, or sendaddrv2).

So, I'd like to ensure that btcd clients will initiate an addr related message to outbound peers. I've looked in the code and believe the software plays nice, and am looking for a +1 from someone more familiar with this project.

In server.go, I believe the peerHandler() calls handleAddPeerMsg when the node connects to a new peer (link). The logic of that function seems like if it successfully connects to an outbound peer on mainnet, it will send an addr message to self advertise, and sometimes send a getaddr message (link). Is this an accurate interpretation?

If my understanding is right, there should be no compatibility issues with my proposed changes.

tldr; I'm proposing a change to Bitcoin Core and want to make sure it does not break btcd, can someone confirm my understanding of the code?

Thanks in advance!
Amiti

@Roasbeef
Copy link
Member

So, I'd like to ensure that btcd clients will initiate an addr related message to outbound peers

Yeah your reading of the code is correct, we'll always send a getaddr to newly connected outbound peers, unless its simnet, or we aren't listening ourselves on a public network interface.

@amitiuttarwar
Copy link
Author

awesome! thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants