-
Notifications
You must be signed in to change notification settings - Fork 292
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
peer: Simplify PushAddrMsg method loop. #232
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The getaddr msg is usually replied to with an addr msg, but if the other peer does not have any addresses to share it will not reply at all (instead of replying with an addr msg with 0 addresses). Therefore, the getaddr msg is not guaranteed a reply, so this commit removes it from stall detection to avoid incorrectly kicking such peers.
When a persistent peer is disconnected (for example due to a network timeout), a connection retry is issued. The logic for doing so failed to remove the peer from the peerState, causing dead peer connections to fill the peerState. Since connections in the peerState are counted towards the maxPeers limit, this would cause btcd to eventually stop retrying connection. This commit fixes the issue by properly removing the peer from the peerState.
Reviewed changelog and fixed 2 tiny typos.
guidelinestherin ---> guidelines therein.
Changed the order of return values described in the docs to be consistent with the function’s actual return value signature.
Found via github.com/mvdan/interfacer.
Also disconnect the failed peer to allow the peerDoneHandler goroutine to exit, instead of hanging around. Fixes btcsuite#583.
This implementation ensures that all addresses have an equal chance of being included in the addr message. It also moves the pseudorandom number generator seeding to package level so that it can be overridden for testing if required.
Contains the following upstream commits: - 87182a2 - This commit does not apply to Decred so it has been reverted - 89af747 - This commit has already been cherry picked and is a NOOP - d0cdd53 - This commit has already been cherry picked and is a NOOP - df20c10 - ff0c787 - 6e133b5 - 34a94b7 - 14ccab8
Upstream commit e03fa30.
tACK runs well on testnet and simnet |
OK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upstream commit e03fa30.