-
Notifications
You must be signed in to change notification settings - Fork 897
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
check for self in one more spot #4521
Conversation
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
@@ -359,8 +359,10 @@ void checkMaintainedConnectionPeers() { | |||
if (!localNode.isReady()) { | |||
return; | |||
} | |||
final EnodeURL localEnodeURL = localNode.getPeer().getEnodeURL(); | |||
maintainedPeers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a good reason why self exists in the maintainedPeers set? Or is that being looked at separately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the way the code is now, at startup, you don't know your own enode at the time the static nodes are added to the maintainedPeers set, so you can't avoid adding your own enode
maintainedPeers | ||
.streamPeers() | ||
.filter(peer -> !peer.getEnodeURL().getNodeId().equals(localEnodeURL.getNodeId())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is enoudeURL::equals working in this case?
* check for self in one more spot Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com> Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
* check for self in one more spot Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane macfarla.github@gmail.com
When regularly checking connections to maintained peers (static nodes), ensure connection to self is not initiated.
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog