Remove cs_main from ThreadMnbRequestConnections (#1658)

This commit is contained in:
UdjinM6 2017-09-28 15:03:39 +03:00 committed by GitHub
parent f77efcf247
commit 278cf144b3

View File

@ -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();
}
}