mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
net: pass CConnman via pointer rather than reference
There are a few too many edge-cases here to make this a scripted diff. The following commits will move a few functions into PeerLogicValidation, where the local connman instance can be used. This change prepares for that usage.
This commit is contained in:
@@ -1114,7 +1114,7 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
|
||||
CNode* pnode = new CNode(id, nLocalServices, GetBestHeight(), hSocket, addr, CalculateKeyedNetGroup(addr), nonce, addr_bind, "", true);
|
||||
pnode->AddRef();
|
||||
pnode->fWhitelisted = whitelisted;
|
||||
GetNodeSignals().InitializeNode(pnode, *this);
|
||||
GetNodeSignals().InitializeNode(pnode, this);
|
||||
|
||||
LogPrint(BCLog::NET, "connection from %s accepted\n", addr.ToString());
|
||||
|
||||
@@ -1966,7 +1966,7 @@ bool CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFai
|
||||
if (fAddnode)
|
||||
pnode->fAddnode = true;
|
||||
|
||||
GetNodeSignals().InitializeNode(pnode, *this);
|
||||
GetNodeSignals().InitializeNode(pnode, this);
|
||||
{
|
||||
LOCK(cs_vNodes);
|
||||
vNodes.push_back(pnode);
|
||||
@@ -1996,7 +1996,7 @@ void CConnman::ThreadMessageHandler()
|
||||
continue;
|
||||
|
||||
// Receive messages
|
||||
bool fMoreNodeWork = GetNodeSignals().ProcessMessages(pnode, *this, flagInterruptMsgProc);
|
||||
bool fMoreNodeWork = GetNodeSignals().ProcessMessages(pnode, this, flagInterruptMsgProc);
|
||||
fMoreWork |= (fMoreNodeWork && !pnode->fPauseSend);
|
||||
if (flagInterruptMsgProc)
|
||||
return;
|
||||
@@ -2004,7 +2004,7 @@ void CConnman::ThreadMessageHandler()
|
||||
// Send messages
|
||||
{
|
||||
LOCK(pnode->cs_sendProcessing);
|
||||
GetNodeSignals().SendMessages(pnode, *this, flagInterruptMsgProc);
|
||||
GetNodeSignals().SendMessages(pnode, this, flagInterruptMsgProc);
|
||||
}
|
||||
if (flagInterruptMsgProc)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user