From 0f1707de678a23b8600510be366289071203fc6e Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 14 May 2012 17:15:58 +0200 Subject: -onlynet instead of -blocknet --- src/init.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 0d3679657..f1599ed3a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -204,7 +204,7 @@ std::string HelpMessage() " -connect= " + _("Connect only to the specified node") + "\n" + " -seednode= " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n" + " -externalip= " + _("Specify your own public address") + "\n" + - " -blocknet= " + _("Do not connect to addresses in network (IPv4 or IPv6)") + "\n" + + " -onlynet= " + _("Only connect to nodes in network (IPv4 or IPv6)") + "\n" + " -discover " + _("Try to discover public IP address (default: 1)") + "\n" + " -irc " + _("Find peers using internet relay chat (default: 0)") + "\n" + " -listen " + _("Accept connections from outside (default: 1)") + "\n" + @@ -572,12 +572,18 @@ bool AppInit2() SoftSetBoolArg("-discover", false); } - if (mapArgs.count("-blocknet")) { - BOOST_FOREACH(std::string snet, mapMultiArgs["-blocknet"]) { + if (mapArgs.count("-onlynet")) { + std::set nets; + BOOST_FOREACH(std::string snet, mapMultiArgs["-onlynet"]) { enum Network net = ParseNetwork(snet); if (net == NET_UNROUTABLE) - return InitError(strprintf(_("Unknown network specified in -blocknet: '%s'"), snet.c_str())); - SetLimited(net); + return InitError(strprintf(_("Unknown network specified in -onlynet: '%s'"), snet.c_str())); + nets.insert(net); + } + for (int n = 0; n < NET_MAX; n++) { + enum Network net = (enum Network)n; + if (!nets.count(net)) + SetLimited(net); } } -- cgit v1.2.3