Remove cs_main from ThreadMnbRequestConnections (#1658)
This commit is contained in:
parent
f77efcf247
commit
278cf144b3
15
src/net.cpp
15
src/net.cpp
@ -1858,13 +1858,12 @@ void CConnman::ThreadMnbRequestConnections()
|
||||
std::pair<CService, std::set<uint256> > p = mnodeman.PopScheduledMnbRequestConnection();
|
||||
if(p.first == CService() || p.second.empty()) continue;
|
||||
|
||||
CNode* pnode = NULL;
|
||||
{
|
||||
LOCK2(cs_main, cs_vNodes);
|
||||
pnode = ConnectNode(CAddress(p.first, NODE_NETWORK), NULL, true);
|
||||
if(!pnode) continue;
|
||||
pnode->AddRef();
|
||||
}
|
||||
ConnectNode(CAddress(p.first, NODE_NETWORK), NULL, true);
|
||||
|
||||
LOCK(cs_vNodes);
|
||||
|
||||
CNode *pnode = FindNode(p.first);
|
||||
if(!pnode || pnode->fDisconnect) continue;
|
||||
|
||||
grant.MoveTo(pnode->grantMasternodeOutbound);
|
||||
|
||||
@ -1881,8 +1880,6 @@ void CConnman::ThreadMnbRequestConnections()
|
||||
|
||||
// ask for data
|
||||
PushMessage(pnode, NetMsgType::GETDATA, vToFetch);
|
||||
|
||||
pnode->Release();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user