diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-12-09 14:08:51 +1000 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-12-09 14:10:10 +1000 |
commit | 80ecf6702ad53488758d431133585b1e5c8b57f0 (patch) | |
tree | 22172c5399a038628a94084d2d72c887c7a9e26d /src/net.cpp | |
parent | 70370ae502df8756f3a067a00ccd61b9fc819581 (diff) |
Add ThreadGetMyExternalIP to net thread group
Fixes #3372 -- crash at shutdown.
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp index afffbdf1da..99a56a0a5d 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -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() // 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) if (pnodeLocalHost == NULL) pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress(CService("127.0.0.1", 0), nLocalServices)); - Discover(); + Discover(threadGroup); // // Start threads |