From 5f88e8887a31db68493334fc8e5652c5dd9cbf89 Mon Sep 17 00:00:00 2001 From: Witchspace Date: Wed, 22 Dec 2010 14:08:00 +0100 Subject: add -nolisten command line option --- init.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'init.cpp') diff --git a/init.cpp b/init.cpp index 61ca4d2bd..cfb5d8e33 100644 --- a/init.cpp +++ b/init.cpp @@ -181,7 +181,8 @@ bool AppInit2(int argc, char* argv[]) " -rpcpassword=\t " + _("Password for JSON-RPC connections\n") + " -rpcport= \t\t " + _("Listen for JSON-RPC connections on \n") + " -rpcallowip= \t\t " + _("Allow JSON-RPC connections from specified IP address\n") + - " -rpcconnect= \t " + _("Send commands to node running on \n"); + " -rpcconnect= \t " + _("Send commands to node running on \n") + + " -nolisten \t " + _("Don't accept connections from outside"); #ifdef USE_SSL strUsage += string() + @@ -211,6 +212,8 @@ bool AppInit2(int argc, char* argv[]) fPrintToDebugger = GetBoolArg("-printtodebugger"); fTestNet = GetBoolArg("-testnet"); + + fNoListen = GetBoolArg("-nolisten"); if (fCommandLine) { @@ -290,10 +293,13 @@ bool AppInit2(int argc, char* argv[]) // Bind to the port early so we can tell if another instance is already running. string strErrors; - if (!BindListenPort(strErrors)) + if (!fNoListen) { - wxMessageBox(strErrors, "Bitcoin"); - return false; + if (!BindListenPort(strErrors)) + { + wxMessageBox(strErrors, "Bitcoin"); + return false; + } } // -- cgit v1.2.3