-
Notifications
You must be signed in to change notification settings - Fork 38.7k
init: avoid unsetting service bits from nLocalServices
#25887
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
init: avoid unsetting service bits from nLocalServices
#25887
Conversation
03f2333 to
a681bb3
Compare
stickies-v
left a comment
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.
Approach ACK a681bb33d8645acf9e7d4f007c4835f9a39aaae0
init.cpp::nLocalServices doesn't get exposed until at the end of AppInitMain() where the flag is now set, so I don't see how this can lead to any behaviour change (except for the different logging)
nLocalServicesnLocalServices
Rather than setting the service bit `NODE_NETWORK` first and then unset it, start out the bare minimum flags that every node serves and only add `NODE_NETWORK` if we are running as a non-pruned node.
a681bb3 to
1b5bec7
Compare
stickies-v
left a comment
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.
ACK 1b5bec7
|
ACK 1b5bec7 |
LarryRuane
left a comment
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.
ACK 1b5bec7
…ervices` 1b5bec7 init: avoid unsetting service bits from `nLocalServices` (Sebastian Falbesoner) Pull request description: This PR is a late follow-up to the [review club session about the PR "Default to NODE_WITNESS in nLocalServices" ](https://bitcoincore.reviews/21090#l-90) (bitcoin#21090): ``` 17:32 <lightlike> hmm, if we are in pruned mode, we first set NODE_NETWORK and then unset it later in init.cpp. that seems a bit strange. ... 17:33 <jnewbery> lightlike: ah yes, you're right. That does seem a bit messy. ``` Rather than setting the service bit `NODE_NETWORK` first and then unset it (if in `fPruneMode`), start with the bare minimum flags that we always serve and only add `NODE_NETWORK` if we are running as a non-pruned node. This seems to be a more logical approach than currently on master. ACKs for top commit: naumenkogs: ACK 1b5bec7 stickies-v: ACK 1b5bec7 LarryRuane: ACK 1b5bec7 Tree-SHA512: 2e82d66c4298ffacff41d9e0458b74b83bc156a1fa49e3f3471e942878e5dd2b253b5597ee5ec1d9c8726b432751d05e40f0c580f3976a9e00a7d1f417921ab0
This PR is a late follow-up to the review club session about the PR "Default to NODE_WITNESS in nLocalServices" (#21090):
Rather than setting the service bit
NODE_NETWORKfirst and then unset it (if infPruneMode), start with the bare minimum flags that we always serve and only addNODE_NETWORKif we are running as a non-pruned node. This seems to be a more logical approach than currently on master.