Skip to content
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

Merged
merged 3 commits into from Feb 6, 2017

Conversation

jtimon
Copy link
Contributor

@jtimon jtimon commented Jan 31, 2017

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

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);
Copy link
Contributor

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.

@TheBlueMatt
Copy link
Contributor

TheBlueMatt commented Feb 1, 2017

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

@jtimon
Copy link
Contributor Author

jtimon commented Feb 1, 2017

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

Copy link
Contributor

@TheBlueMatt TheBlueMatt left a 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)
Copy link
Contributor

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

Copy link
Contributor Author

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?

@laanwj
Copy link
Member

laanwj commented Feb 6, 2017

utACK 0729102

@laanwj laanwj merged commit 0729102 into bitcoin:master Feb 6, 2017
laanwj added a commit that referenced this pull request Feb 6, 2017
0729102 Net: pass interruptMsgProc as const where possible (Jorge Timón)
fc7f2ff Net: Make CNetMsgMaker more const (Jorge Timón)
d45955f Net: CConnman: Make some methods const (Jorge Timón)
codablock pushed a commit to codablock/dash that referenced this pull request Jan 23, 2018
0729102 Net: pass interruptMsgProc as const where possible (Jorge Timón)
fc7f2ff Net: Make CNetMsgMaker more const (Jorge Timón)
d45955f Net: CConnman: Make some methods const (Jorge Timón)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
0729102 Net: pass interruptMsgProc as const where possible (Jorge Timón)
fc7f2ff Net: Make CNetMsgMaker more const (Jorge Timón)
d45955f Net: CConnman: Make some methods const (Jorge Timón)
CryptoCentric pushed a commit to absolute-community/absolute that referenced this pull request Feb 27, 2019
0729102 Net: pass interruptMsgProc as const where possible (Jorge Timón)
fc7f2ff Net: Make CNetMsgMaker more const (Jorge Timón)
d45955f Net: CConnman: Make some methods const (Jorge Timón)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants