From 19b6958cfd5c5207ffe8259ef48ebbd24ca89725 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 19 Feb 2012 20:44:35 +0100 Subject: Added -externalip and -discover -externalip= can be used to explicitly set the public IP address of your node. -discover=0 can be used to disable the automatic public IP discovery system. --- src/init.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index f9ea998ce..469642897 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -187,6 +187,8 @@ bool AppInit2(int argc, char* argv[]) " -addnode= \t " + _("Add a node to connect to and attempt to keep the connection open") + "\n" + " -connect= \t\t " + _("Connect only to the specified node") + "\n" + " -seednode= \t\t " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n" + + " -externalip= \t " + _("Specify your own public address") + "\n" + + " -discover \t " + _("Try to discover public IP address (default: 1)") + "\n" + " -irc \t " + _("Find peers using internet relay chat (default: 0)") + "\n" + " -listen \t " + _("Accept connections from outside (default: 1)") + "\n" + #ifdef QT_GUI @@ -519,6 +521,9 @@ bool AppInit2(int argc, char* argv[]) } } + if (mapArgs.count("-connect")) + SoftSetBoolArg("-dnsseed", false); + bool fTor = (fUseProxy && addrProxy.GetPort() == 9050); if (fTor) { @@ -528,6 +533,7 @@ bool AppInit2(int argc, char* argv[]) SoftSetBoolArg("-irc", false); SoftSetBoolArg("-proxydns", true); SoftSetBoolArg("-upnp", false); + SoftSetBoolArg("-discover", false); } fNameLookup = GetBoolArg("-dns"); @@ -556,6 +562,12 @@ bool AppInit2(int argc, char* argv[]) } } + if (mapArgs.count("-externalip")) + { + BOOST_FOREACH(string strAddr, mapMultiArgs["-externalip"]) + AddLocal(CNetAddr(strAddr, fNameLookup), LOCAL_MANUAL); + } + if (mapArgs.count("-paytxfee")) { if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee)) -- cgit v1.2.3