aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-05-26 23:29:39 -0400
committerCory Fields <cory-nospam-@coryfields.com>2016-09-08 12:24:07 -0400
commitbafa5fc5a1ba33337b5eb3d8ae24ba2fac2949f8 (patch)
tree5d166b29ad0378d7e8394e21271ad9863d515b3f /src/init.cpp
parente81a602cf02edfb21c3ec097bd7cf71f189ed783 (diff)
net: Drop StartNode/StopNode and use CConnman directly
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 9e2ed62a92..4e1c8e1b61 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -199,7 +199,8 @@ void Shutdown()
if (pwalletMain)
pwalletMain->Flush(false);
#endif
- StopNode(*g_connman);
+ MapPort(false);
+ g_connman->Stop();
g_connman.reset();
StopTorControl();
@@ -1508,9 +1509,14 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
if (GetBoolArg("-listenonion", DEFAULT_LISTEN_ONION))
StartTorControl(threadGroup, scheduler);
+ Discover(threadGroup);
+
+ // Map ports with UPnP
+ MapPort(GetBoolArg("-upnp", DEFAULT_UPNP));
+
std::string strNodeError;
int nMaxOutbound = std::min(MAX_OUTBOUND_CONNECTIONS, nMaxConnections);
- if(!StartNode(connman, threadGroup, scheduler, nLocalServices, nRelevantServices, nMaxConnections, nMaxOutbound, chainActive.Height(), &uiInterface, strNodeError))
+ if(!connman.Start(threadGroup, scheduler, nLocalServices, nRelevantServices, nMaxConnections, nMaxOutbound, chainActive.Height(), &uiInterface, strNodeError))
return InitError(strNodeError);
// ********************************************************* Step 12: finished