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: contributor

    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: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    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. DrahtBot cross-referenced this on Jan 16, 2022 from issue BIP324: Add encrypted p2p transport {de}serializer by dhruv
  9. DrahtBot cross-referenced this on Jan 16, 2022 from issue refactor: Release cs_main before MaybeSendFeefilter by MarcoFalke
  10. DrahtBot cross-referenced this on Jan 16, 2022 from issue net_processing: lock clean up by ajtowns
  11. shaavan approved
  12. 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.
  13. w0xlt approved
  14. w0xlt commented at 3:04 PM on January 23, 2022: contributor

    crACK 224d878

  15. MarcoFalke merged this on Jan 24, 2022
  16. MarcoFalke closed this on Jan 24, 2022

  17. hebasto deleted the branch on Jan 24, 2022
  18. 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.

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

  19. shaavan cross-referenced this on Jan 24, 2022 from issue Rename message_command variables in src/net* and src/rpc/net.cpp by shaavan
  20. sidhujag referenced this in commit b135edda87 on Jan 28, 2022
  21. MarcoFalke referenced this in commit 0d080a183b on May 5, 2022
  22. sidhujag referenced this in commit aebd7a230d on May 5, 2022
  23. bitcoin 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: 2026-05-19 06:53 UTC