Skip to content

Commit 80ecf67

Browse files
committed
Add ThreadGetMyExternalIP to net thread group
Fixes #3372 -- crash at shutdown.
1 parent 70370ae commit 80ecf67

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/net.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ bool BindListenPort(const CService &addrBind, string& strError)
16901690
return true;
16911691
}
16921692

1693-
void static Discover()
1693+
void static Discover(boost::thread_group& threadGroup)
16941694
{
16951695
if (!fDiscover)
16961696
return;
@@ -1743,7 +1743,7 @@ void static Discover()
17431743

17441744
// Don't use external IPv4 discovery, when -onlynet="IPv6"
17451745
if (!IsLimited(NET_IPV4))
1746-
boost::thread(boost::bind(&TraceThread<void (*)()>, "ext-ip", &ThreadGetMyExternalIP));
1746+
threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "ext-ip", &ThreadGetMyExternalIP));
17471747
}
17481748

17491749
void StartNode(boost::thread_group& threadGroup)
@@ -1757,7 +1757,7 @@ void StartNode(boost::thread_group& threadGroup)
17571757
if (pnodeLocalHost == NULL)
17581758
pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress(CService("127.0.0.1", 0), nLocalServices));
17591759

1760-
Discover();
1760+
Discover(threadGroup);
17611761

17621762
//
17631763
// Start threads

0 commit comments

Comments
 (0)