mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
retry IRC if name in use,
resize to fit ubuntu's giant default font, scroll debug.log, pause gen during initial block download
This commit is contained in:
parent
ba0909e96a
commit
0bbbee96b7
13 changed files with 187 additions and 89 deletions
25
net.cpp
25
net.cpp
|
|
@ -21,7 +21,6 @@ uint64 nLocalServices = (fClient ? 0 : NODE_NETWORK);
|
|||
CAddress addrLocalHost(0, DEFAULT_PORT, nLocalServices);
|
||||
CNode* pnodeLocalHost = NULL;
|
||||
uint64 nLocalHostNonce = 0;
|
||||
bool fShutdown = false;
|
||||
array<int, 10> vnThreadsRunning;
|
||||
SOCKET hListenSocket = INVALID_SOCKET;
|
||||
int64 nThreadSocketHandlerHeartbeat = INT64_MAX;
|
||||
|
|
@ -1324,3 +1323,27 @@ bool StopNode()
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
class CNetCleanup
|
||||
{
|
||||
public:
|
||||
CNetCleanup()
|
||||
{
|
||||
}
|
||||
~CNetCleanup()
|
||||
{
|
||||
// Close sockets
|
||||
foreach(CNode* pnode, vNodes)
|
||||
if (pnode->hSocket != INVALID_SOCKET)
|
||||
closesocket(pnode->hSocket);
|
||||
if (hListenSocket != INVALID_SOCKET)
|
||||
if (closesocket(hListenSocket) == SOCKET_ERROR)
|
||||
printf("closesocket(hListenSocket) failed with error %d\n", WSAGetLastError());
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// Shutdown Windows Sockets
|
||||
WSACleanup();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
instance_of_cnetcleanup;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue