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
Net: Turn some methods and params/variables const #9659
Conversation
src/net.cpp
Outdated
@@ -1871,7 +1871,7 @@ void CConnman::ThreadMessageHandler() | |||
// Send messages | |||
{ | |||
LOCK(pnode->cs_sendProcessing); | |||
GetNodeSignals().SendMessages(pnode, *this, flagInterruptMsgProc); | |||
GetNodeSignals().SendMessages(pnode, *this); |
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.
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.
General concept ack, with the exception of removing the flagInterruptMsg pass (but please do make it const) |
Great, it seems I was right on leaving the last commit separated, I'll leave it out. |
9c0d421
to
0729102
Compare
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.
utACK 0729102 (+/- SocketSendData being made const).
@@ -754,7 +754,7 @@ const uint256& CNetMessage::GetMessageHash() const | |||
|
|||
|
|||
// requires LOCK(cs_vSend) | |||
size_t CConnman::SocketSendData(CNode *pnode) |
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.
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...
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.
Well, writing to the peer itself here is writing to pnode, which isn't const, no?
utACK 0729102 |
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).