From 80ecf6702ad53488758d431133585b1e5c8b57f0 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Mon, 9 Dec 2013 14:08:51 +1000 Subject: [PATCH] Add ThreadGetMyExternalIP to net thread group Fixes #3372 -- crash at shutdown. --- src/net.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index afffbdf1d..99a56a0a5 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, "ext-ip", &ThreadGetMyExternalIP)); + threadGroup.create_thread(boost::bind(&TraceThread, "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