Net: Turn some methods and params/variables const #9659

pull jtimon wants to merge 3 commits into bitcoin:master from jtimon:0.14-net-more-const changing 5 files +19 −19
  1. jtimon commented at 10:51 PM on January 31, 2017: contributor

    Also remove currently unused interruptMsgProc param from SendMessages. I guess some squashing can be done (but I'm worried that interruptMsgProc is planned to be used in SendMessages later).

  2. Net: CConnman: Make some methods const d45955fa09
  3. Net: Make CNetMsgMaker more const fc7f2ffad4
  4. Net: pass interruptMsgProc as const where possible 0729102f99
  5. jtimon cross-referenced this on Jan 31, 2017 from issue Net: Divide ProcessMessage in smaller functions by jtimon
  6. jtimon cross-referenced this on Jan 31, 2017 from issue Net: Trivial-review: Make SendMessages easier to review by jtimon
  7. in src/net.cpp:None in 9c0d42177a outdated
    1870 | @@ -1871,7 +1871,7 @@ void CConnman::ThreadMessageHandler()
    1871 |              // Send messages
    1872 |              {
    1873 |                  LOCK(pnode->cs_sendProcessing);
    1874 | -                GetNodeSignals().SendMessages(pnode, *this, flagInterruptMsgProc);
    1875 | +                GetNodeSignals().SendMessages(pnode, *this);
    


    TheBlueMatt commented at 11:52 PM on January 31, 2017:

    Even if we dont use it now, I'm not sure we want to get rid of passing flagInterruptMsgProc through...there is a strong case for using it in 0.15.

  8. TheBlueMatt commented at 12:03 AM on February 1, 2017: contributor

    General concept ack, with the exception of removing the flagInterruptMsg pass (but please do make it const)

  9. jtimon commented at 1:18 AM on February 1, 2017: contributor

    Great, it seems I was right on leaving the last commit separated, I'll leave it out.

  10. jtimon force-pushed on Feb 1, 2017
  11. jonasschnelli added the label Refactoring on Feb 1, 2017
  12. in src/net.cpp:None in 0729102f99
     753 | @@ -754,7 +754,7 @@ const uint256& CNetMessage::GetMessageHash() const
     754 |  
     755 |  
     756 |  // requires LOCK(cs_vSend)
     757 | -size_t CConnman::SocketSendData(CNode *pnode)
    


    TheBlueMatt commented at 9:41 PM on February 1, 2017:

    Hmm...while technicall const for the CConnman, I'm not sure this "should be const" given that it is writing data to the peer itself...


    jtimon commented at 11:10 PM on February 2, 2017:

    Well, writing to the peer itself here is writing to pnode, which isn't const, no?

  13. TheBlueMatt commented at 10:31 PM on February 1, 2017: contributor

    utACK 0729102f99241b9716456ad40bf778c09f650b1b (+/- SocketSendData being made const).

  14. laanwj commented at 1:34 PM on February 6, 2017: member

    utACK 0729102

  15. laanwj merged this on Feb 6, 2017
  16. laanwj closed this on Feb 6, 2017

  17. laanwj referenced this in commit 09e0c28f85 on Feb 6, 2017
  18. codablock referenced this in commit 7026c35208 on Jan 19, 2018
  19. codablock referenced this in commit 3f1929fb0d on Jan 23, 2018
  20. gladcow cross-referenced this on Mar 1, 2018 from issue Backport compact blocks functionality from bitcoin by gladcow
  21. gladcow referenced this in commit 87387c4306 on Mar 8, 2018
  22. gladcow referenced this in commit 80c2f36c5d on Mar 13, 2018
  23. dagurval cross-referenced this on Jun 8, 2018 from issue More net cherries by dagurval
  24. andvgal referenced this in commit 423788ba89 on Jan 6, 2019
  25. CryptoCentric referenced this in commit 1a1424842b on Feb 27, 2019
  26. bitcoin locked this on Sep 8, 2021

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:55 UTC