|
|
@ -2222,8 +2222,6 @@ CConnman::CConnman(uint64_t nSeed0In, uint64_t nSeed1In) : nSeed0(nSeed0In), nSe
|
|
|
|
nLastNodeId = 0;
|
|
|
|
nLastNodeId = 0;
|
|
|
|
nSendBufferMaxSize = 0;
|
|
|
|
nSendBufferMaxSize = 0;
|
|
|
|
nReceiveFloodSize = 0;
|
|
|
|
nReceiveFloodSize = 0;
|
|
|
|
semOutbound = nullptr;
|
|
|
|
|
|
|
|
semAddnode = nullptr;
|
|
|
|
|
|
|
|
flagInterruptMsgProc = false;
|
|
|
|
flagInterruptMsgProc = false;
|
|
|
|
SetTryNewOutboundPeer(false);
|
|
|
|
SetTryNewOutboundPeer(false);
|
|
|
|
|
|
|
|
|
|
|
@ -2329,11 +2327,11 @@ bool CConnman::Start(CScheduler& scheduler, const Options& connOptions)
|
|
|
|
|
|
|
|
|
|
|
|
if (semOutbound == nullptr) {
|
|
|
|
if (semOutbound == nullptr) {
|
|
|
|
// initialize semaphore
|
|
|
|
// initialize semaphore
|
|
|
|
semOutbound = new CSemaphore(std::min((nMaxOutbound + nMaxFeeler), nMaxConnections));
|
|
|
|
semOutbound = std::unique_ptr<CSemaphore>(new CSemaphore(std::min((nMaxOutbound + nMaxFeeler), nMaxConnections)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (semAddnode == nullptr) {
|
|
|
|
if (semAddnode == nullptr) {
|
|
|
|
// initialize semaphore
|
|
|
|
// initialize semaphore
|
|
|
|
semAddnode = new CSemaphore(nMaxAddnode);
|
|
|
|
semAddnode = std::unique_ptr<CSemaphore>(new CSemaphore(nMaxAddnode));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -2456,10 +2454,8 @@ void CConnman::Stop()
|
|
|
|
vNodes.clear();
|
|
|
|
vNodes.clear();
|
|
|
|
vNodesDisconnected.clear();
|
|
|
|
vNodesDisconnected.clear();
|
|
|
|
vhListenSocket.clear();
|
|
|
|
vhListenSocket.clear();
|
|
|
|
delete semOutbound;
|
|
|
|
semOutbound.reset();
|
|
|
|
semOutbound = nullptr;
|
|
|
|
semAddnode.reset();
|
|
|
|
delete semAddnode;
|
|
|
|
|
|
|
|
semAddnode = nullptr;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CConnman::DeleteNode(CNode* pnode)
|
|
|
|
void CConnman::DeleteNode(CNode* pnode)
|
|
|
|