-
Notifications
You must be signed in to change notification settings - Fork 293
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
server: Reject outbound conns to non-full nodes. #1252
server: Reject outbound conns to non-full nodes. #1252
Conversation
878874d
to
017c2b2
Compare
017c2b2
to
dbc42cd
Compare
dbc42cd
to
fe73bee
Compare
server.go
Outdated
wantServices := wire.SFNodeNetwork | ||
if !sp.Inbound() && !hasServices(msg.Services, wantServices) { | ||
srvrLog.Debugf("Rejecting peer %s with services %v due to not "+ | ||
"providing desired services %v", msg.Services, wantServices) |
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.
We could improve this by masking everything off except the missing services: wantServices&^msg.Services
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.
Doesn't really matter for dcrd's case as it only needs a single service flag, so it would be the same result either way, but that could change in the future.
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.
I agree that it currently is the same, but I think it's a good idea, because I would expect there to be pruned nodes in the future with a new service bit, in which case it would matter.
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.
Updated.
fe73bee
to
7f2e71b
Compare
This modifies the server connection code to reject outbound peers that do not offer full node services.
7f2e71b
to
166c71e
Compare
This requires PR #1251.
This modifies the server connection code to reject outbound peers that do not offer full node services.