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

getaddr immediately after handshake returns only the called node #29

Closed
mocmocamoc opened this issue Nov 6, 2017 · 2 comments
Closed

Comments

@mocmocamoc
Copy link

From my experiments with Satoshi:0.15.0.1, calling getaddr() immediately after handshake() always returns only the single node you are connected to. This is because the handshake causes the remote node to send an "addr" message containing just information about itself, which is then retrieved by getaddr() instead of the actual response to the "getaddr" message that it sends. To demonstrate this, call handshake() and then get_messages().

Hence the first "addr" message received after the handshake should be discarded to ensure you're using the actual response to "getaddr" for the list of nodes.

@mocmocamoc
Copy link
Author

I think the real problem is that Connection.getaddr() only waits one second between sending "getaddr" and checking for "addr" responses. In reality it seems to take longer (sometimes up to a minute) for the full response to "getaddr" to come back. I'm not sure if it's viable for the crawler to wait that long for the response.

@ayeowch
Copy link
Owner

ayeowch commented Feb 4, 2018

Fixed via 1177a47

@ayeowch ayeowch closed this as completed Feb 4, 2018
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