mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-11 08:06:06 +01:00
Merge #8128: Net: Turn net structures into dumb storage classes
9e9d644net: fixup nits (Cory Fields)8945384net: Have LookupNumeric return a CService directly (Cory Fields)21ba407net: narrow include scope after moving to netaddress (Cory Fields)21e5b96net: move CNetAddr/CService/CSubNet out of netbase (Cory Fields)1017b8anet: Add direct tests for new CSubNet constructors (Cory Fields)b6c3ff3net: Split resolving out of CSubNet (Cory Fields)f96c7c4net: Split resolving out of CService (Cory Fields)31d6b1dnet: Split resolving out of CNetAddr (Cory Fields)
This commit is contained in:
10
src/init.cpp
10
src/init.cpp
@@ -21,6 +21,7 @@
|
||||
#include "key.h"
|
||||
#include "main.h"
|
||||
#include "miner.h"
|
||||
#include "netbase.h"
|
||||
#include "net.h"
|
||||
#include "policy/policy.h"
|
||||
#include "rpc/server.h"
|
||||
@@ -1134,7 +1135,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||
|
||||
if (mapArgs.count("-whitelist")) {
|
||||
BOOST_FOREACH(const std::string& net, mapMultiArgs["-whitelist"]) {
|
||||
CSubNet subnet(net);
|
||||
CSubNet subnet;
|
||||
LookupSubNet(net.c_str(), subnet);
|
||||
if (!subnet.IsValid())
|
||||
return InitError(strprintf(_("Invalid netmask specified in -whitelist: '%s'"), net));
|
||||
CNode::AddWhitelistedRange(subnet);
|
||||
@@ -1147,7 +1149,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||
std::string proxyArg = GetArg("-proxy", "");
|
||||
SetLimited(NET_TOR);
|
||||
if (proxyArg != "" && proxyArg != "0") {
|
||||
proxyType addrProxy = proxyType(CService(proxyArg, 9050), proxyRandomize);
|
||||
CService resolved(LookupNumeric(proxyArg.c_str(), 9050));
|
||||
proxyType addrProxy = proxyType(resolved, proxyRandomize);
|
||||
if (!addrProxy.IsValid())
|
||||
return InitError(strprintf(_("Invalid -proxy address: '%s'"), proxyArg));
|
||||
|
||||
@@ -1166,7 +1169,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||
if (onionArg == "0") { // Handle -noonion/-onion=0
|
||||
SetLimited(NET_TOR); // set onions as unreachable
|
||||
} else {
|
||||
proxyType addrOnion = proxyType(CService(onionArg, 9050), proxyRandomize);
|
||||
CService resolved(LookupNumeric(onionArg.c_str(), 9050));
|
||||
proxyType addrOnion = proxyType(resolved, proxyRandomize);
|
||||
if (!addrOnion.IsValid())
|
||||
return InitError(strprintf(_("Invalid -onion address: '%s'"), onionArg));
|
||||
SetProxy(NET_TOR, addrOnion);
|
||||
|
||||
Reference in New Issue
Block a user