Browse Source

Add ThreadGetMyExternalIP to net thread group

Fixes #3372 -- crash at shutdown.
0.10
Gavin Andresen 11 years ago
parent
commit
80ecf6702a
  1. 6
      src/net.cpp

6
src/net.cpp

@ -1690,7 +1690,7 @@ bool BindListenPort(const CService &addrBind, string& strError) @@ -1690,7 +1690,7 @@ bool BindListenPort(const CService &addrBind, string& strError)
return true;
}
void static Discover()
void static Discover(boost::thread_group& threadGroup)
{
if (!fDiscover)
return;
@ -1743,7 +1743,7 @@ void static Discover() @@ -1743,7 +1743,7 @@ void static Discover()
// Don't use external IPv4 discovery, when -onlynet="IPv6"
if (!IsLimited(NET_IPV4))
boost::thread(boost::bind(&TraceThread<void (*)()>, "ext-ip", &ThreadGetMyExternalIP));
threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "ext-ip", &ThreadGetMyExternalIP));
}
void StartNode(boost::thread_group& threadGroup)
@ -1757,7 +1757,7 @@ void StartNode(boost::thread_group& threadGroup) @@ -1757,7 +1757,7 @@ void StartNode(boost::thread_group& threadGroup)
if (pnodeLocalHost == NULL)
pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress(CService("127.0.0.1", 0), nLocalServices));
Discover();
Discover(threadGroup);
//
// Start threads

Loading…
Cancel
Save