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();
|
std::pair<CService, std::set<uint256> > p = mnodeman.PopScheduledMnbRequestConnection();
|
||||||
if(p.first == CService() || p.second.empty()) continue;
|
if(p.first == CService() || p.second.empty()) continue;
|
||||||
|
|
||||||
CNode* pnode = NULL;
|
ConnectNode(CAddress(p.first, NODE_NETWORK), NULL, true);
|
||||||
{
|
|
||||||
LOCK2(cs_main, cs_vNodes);
|
LOCK(cs_vNodes);
|
||||||
pnode = ConnectNode(CAddress(p.first, NODE_NETWORK), NULL, true);
|
|
||||||
if(!pnode) continue;
|
CNode *pnode = FindNode(p.first);
|
||||||
pnode->AddRef();
|
if(!pnode || pnode->fDisconnect) continue;
|
||||||
}
|
|
||||||
|
|
||||||
grant.MoveTo(pnode->grantMasternodeOutbound);
|
grant.MoveTo(pnode->grantMasternodeOutbound);
|
||||||
|
|
||||||
@ -1881,8 +1880,6 @@ void CConnman::ThreadMnbRequestConnections()
|
|||||||
|
|
||||||
// ask for data
|
// ask for data
|
||||||
PushMessage(pnode, NetMsgType::GETDATA, vToFetch);
|
PushMessage(pnode, NetMsgType::GETDATA, vToFetch);
|
||||||
|
|
||||||
pnode->Release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user