-
Notifications
You must be signed in to change notification settings - Fork 38.6k
net, refactor: Rename CNetMessage::m_command with CNetMessage::m_type #24078
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
-BEGIN VERIFY SCRIPT- sed -i 's/std::string m_command;/std::string m_type;/g' ./src/net.h sed -i 's/* command and size./* type and size./g' ./src/net.h sed -i 's/msg.m_command/msg.m_type/g' ./src/net.cpp ./src/net_processing.cpp ./src/test/fuzz/p2p_transport_serialization.cpp -END VERIFY SCRIPT-
theStack
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.
Concept and code-review ACK 224d878
There are still quite a few instances of the confusing "command" terminology for message types around, as $ git grep -i command ./src/net* shows. Happy to review further changes in this direction (either in this PR or a follow-up).
|
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. |
shaavan
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.
Code Review ACK 224d878
Going commit wise:
- I agree with this statement, and hence with the change:
a message is not a command, but simply a message of some type
- Removing these redundant variables makes the code more clean and readable.
w0xlt
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.
crACK 224d878
| // decompose a single CNetMessage from the TransportDeserializer | ||
| CNetMessage msg(std::move(vRecv)); | ||
|
|
||
| // store command string, time, and sizes |
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 think there are a few comments which could be updated.
git grep --ignore-case command ./src/net*
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.
Let me take it up as a follow-up.
…h CNetMessage::m_type 224d878 net, refactor: Drop tautological local variables (Hennadii Stepanov) 3073a99 scripted-diff: Rename CNetMessage::m_command with CNetMessage::m_type (Hennadii Stepanov) Pull request description: bitcoin#18533 (comment): > a message is not a command, but simply a message of some type Continuation of bitcoin#18533 and bitcoin#18937. ACKs for top commit: theStack: Concept and code-review ACK 224d878 shaavan: Code Review ACK 224d878 w0xlt: crACK 224d878 Tree-SHA512: 898cafb44708dae1413fcc1533d809d75878891354f1b5edaaec1287f4921c31adc9330f4d42d82544a39689886bc17fee71ea587f9199fd5cc849d376f82176
…c/net.cpp e71c51b refactor: rename command -> message type in comments in the src/net* files (Shashwat) 2b09593 scripted-diff: Rename message command to message type (Shashwat) Pull request description: This PR is a follow-up to #24078. > a message is not a command, but simply a message of some type The first commit covers the message_command variable name and comments not addressed in the original PR in `src/net*` files. The second commit goes beyond the original `src/net*` limit of #24078 and does similar changes in the `src/rpc/net.cpp` file. ACKs for top commit: MarcoFalke: review ACK e71c51b 💥 Tree-SHA512: 24015d132c00f15239e5d3dc7aedae904ae3103a90920bb09e984ff57723402763f697d886322f78e42a0cb46808cb6bc9d4905561dc6ddee9961168f8324b05
… src/rpc/net.cpp e71c51b refactor: rename command -> message type in comments in the src/net* files (Shashwat) 2b09593 scripted-diff: Rename message command to message type (Shashwat) Pull request description: This PR is a follow-up to bitcoin#24078. > a message is not a command, but simply a message of some type The first commit covers the message_command variable name and comments not addressed in the original PR in `src/net*` files. The second commit goes beyond the original `src/net*` limit of bitcoin#24078 and does similar changes in the `src/rpc/net.cpp` file. ACKs for top commit: MarcoFalke: review ACK e71c51b 💥 Tree-SHA512: 24015d132c00f15239e5d3dc7aedae904ae3103a90920bb09e984ff57723402763f697d886322f78e42a0cb46808cb6bc9d4905561dc6ddee9961168f8324b05
#18533 (comment):
Continuation of #18533 and #18937.