-
Notifications
You must be signed in to change notification settings - Fork 37.7k
refactor: Remove SER_GETHASH, hard-code client version in CKeyPool serialize #28508
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
Conversation
GetType() is never called, so it is completely unused and can be removed.
The type is only ever set, but never read via GetType(), so remove it. Also, remove SerializeHash to avoid silent merge conflicts and use the already existing GetHash() boilerplate consistently.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Concept ACK. |
Mind splitting up the last commit? The version number change needs a bit of scrutiny imo, but it's hidden inside an innocuous commit message. |
fa8bb5e
to
fab2583
Compare
Changed the commit title and PR title. Is it good enough? |
It was never set, so it can be removed along with any code reading it.
fab2583
to
fac29a0
Compare
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.
added one nit but otherwise ACK fac29a0
if (!(s.GetType() & SER_GETHASH)) { | ||
s << nVersion; | ||
} | ||
s << int{259900}; // Unused field, writes the highest client version ever written |
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.
nit: in the comment does "highest client version ever written" mean that this is the highest client version that can be written or that we've ever seen written?
Suggestion
"Unused field, writes the highest possible client version"
feel free to ignore this nit aswell!
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.
It is the current client version written. It should be possible to confirm this by adding an std::cout << nVersion << "\n";
here.
The client version is only increased, so it is also the highest.
In any case, the value doesn't matter, so I am happy to replace it with anything else.
Concept ACK |
ACK fac29a0 |
Removes a bunch of redundant, dead or duplicate code.
Uses the idea from and finishes the idea #28428 by theuni