-
Notifications
You must be signed in to change notification settings - Fork 38.8k
[rpc] Remove deprecated fields from getpeerinfo #20755
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
[rpc] Remove deprecated fields from getpeerinfo #20755
Conversation
9b76a46 to
3653ac5
Compare
|
Updated to include PR # in release notes |
|
update: realized QT usage was removed in 784ef8b in bitcoin-core/gui#34. I have since updated this branch to remove |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. |
jonatack
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
3653ac5 to
96ce5dc
Compare
|
I realized this removes the last use of |
|
Nice cleanup. Concept ACK |
96ce5dc to
454a408
Compare
|
rebased |
|
utACK 454a408 |
jnewbery
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 454a408.
You can remove a no-longer-needed local variable if you touch this again.
| pnode->AddRef(); | ||
| pnode->m_permissionFlags = permissionFlags; | ||
| // If this flag is present, the user probably expect that RPC and QT report it as whitelisted (backward compatibility) | ||
| pnode->m_legacyWhitelisted = legacyWhitelisted; |
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.
You can get rid of the local variable legacyWhitelisted entirely.
|
Looks like no one tested this before merging. Fixed in #20791 but as a post mortem should have been tested prior to merging. |
I am not sure what you mean. clang doesn't emit this warning, as explained in #20791 (comment). Merging any pull will be impossible if maintainers are required to build with all supported compiler versions on all supported platforms. Regardless, this has long been pointed out during review: #20755 (review) with the comment: "You can remove a no-longer-needed local variable if you touch this again." Moreover, |
|
This could have been easily caught with a simple manual grep right? For something basic like this someone should do that grep before it is merged? Or am I missing something? The above is interesting context though, thanks. |
Diligence and vigilance does not mean I am suggesting we rush to break the code to silence the compiler. I'm not interested in blame games, only making bitcoin more robust. |
Yes, and I assume that either grep or @jonatack Sorry, didn't want to blame you. It was the most recent example that came to mind. There are many more examples, including many by me. I should have used one of myself. |
|
Thanks. I think given enough time it happens to everyone anyway. Teamwork makes the dream work. |
This is an entirely unhelpful comment. The 'problem' here is that a variable is now unused and certain compilers warn about it. Unused variables are exactly that - unused - and so have no impact on the logic of the program. In fact, compilers will optimize them out, so I expect the produced object is exactly the same before and after #20791. This was spotted in review, found to not be an issue, and would have been fixed if the branch was retouched. Instead it was fixed in a follow-up PR. There's absolutely no problem here.
Just careful review. If a change means that a variable is no longer used in one place, it's good practice to see where else that variable is used. |
|
It seems sloppy to me. Either remove it in the PR or merge it with an instruction that someone should open a new PR to remove it. I don't think it is great hygiene to just leave it hanging in a past comment (but maybe that is just me) Don't want to belabor the point though (especially when being told it is "entirely unhelpful") |
This PR removes support for 3 fields on the
getpeerinfoRPC that were deprecated in v0.21-addnode,banscore&whitelisted.