net, refactor: Rename CNetMessage::m_command with CNetMessage::m_type #24078

pull hebasto wants to merge 2 commits into bitcoin:master from hebasto:220115-message changing 4 files +12 −16
  1. hebasto commented at 7:09 pm on January 15, 2022: member

    #18533#issue-594592488:

    a message is not a command, but simply a message of some type

    Continuation of bitcoin/bitcoin#18533 and bitcoin/bitcoin#18937.

  2. scripted-diff: Rename CNetMessage::m_command with CNetMessage::m_type
    -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-
    3073a9917b
  3. net, refactor: Drop tautological local variables 224d87855e
  4. DrahtBot added the label P2P on Jan 15, 2022
  5. theStack approved
  6. theStack commented at 1:52 am on January 16, 2022: member

    Concept and code-review ACK 224d87855ec38cc15866d9673e1b19942a82c1cd

    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).

  7. DrahtBot commented at 2:44 am on January 16, 2022: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #23233 (BIP324: Add encrypted p2p transport {de}serializer by dhruv)
    • #22053 (refactor: Release cs_main before MaybeSendFeefilter by MarcoFalke)
    • #21527 (net_processing: lock clean up by ajtowns)

    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.

  8. shaavan approved
  9. shaavan commented at 2:18 pm on January 20, 2022: contributor

    Code Review ACK 224d87855ec38cc15866d9673e1b19942a82c1cd

    Going commit wise:

    1. I agree with this statement, and hence with the change:

    a message is not a command, but simply a message of some type

    1. Removing these redundant variables makes the code more clean and readable.
  10. w0xlt approved
  11. w0xlt commented at 3:04 pm on January 23, 2022: contributor
    crACK 224d878
  12. MarcoFalke merged this on Jan 24, 2022
  13. MarcoFalke closed this on Jan 24, 2022

  14. hebasto deleted the branch on Jan 24, 2022
  15. in src/net.cpp:749 in 224d87855e
    746@@ -747,7 +747,7 @@ CNetMessage V1TransportDeserializer::GetMessage(const std::chrono::microseconds
    747     CNetMessage msg(std::move(vRecv));
    748 
    749     // store command string, time, and sizes
    


    MarcoFalke commented at 12:57 pm on January 24, 2022:

    I think there are a few comments which could be updated.

    0git grep --ignore-case command ./src/net*
    

    shaavan commented at 1:43 pm on January 24, 2022:
    Let me take it up as a follow-up.
  16. sidhujag referenced this in commit b135edda87 on Jan 28, 2022
  17. MarcoFalke referenced this in commit 0d080a183b on May 5, 2022
  18. sidhujag referenced this in commit aebd7a230d on May 5, 2022
  19. DrahtBot locked this on Jan 24, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-30 00:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me