mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02: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:
parent
bcc8a620ea
commit
28f11e9406
5 changed files with 104 additions and 104 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue