@ -1358,7 +1358,7 @@ bool AppInitMain()
// -proxy sets a proxy for all outgoing network traffic
// -noproxy (or -proxy=0) as well as the empty string can be used to not set a proxy, this is the default
std : : string proxyArg = gArgs . GetArg ( " -proxy " , " " ) ;
SetLimited ( NET_ TOR ) ;
SetLimited ( NET_ ONION ) ;
if ( proxyArg ! = " " & & proxyArg ! = " 0 " ) {
CService proxyAddr ;
if ( ! Lookup ( proxyArg . c_str ( ) , proxyAddr , 9050 , fNameLookup ) ) {
@ -1371,9 +1371,9 @@ bool AppInitMain()
SetProxy ( NET_IPV4 , addrProxy ) ;
SetProxy ( NET_IPV6 , addrProxy ) ;
SetProxy ( NET_ TOR , addrProxy ) ;
SetProxy ( NET_ ONION , addrProxy ) ;
SetNameProxy ( addrProxy ) ;
SetLimited ( NET_ TOR , false ) ; // by default, -proxy sets onion as reachable, unless -noonion later
SetLimited ( NET_ ONION , false ) ; // by default, -proxy sets onion as reachable, unless -noonion later
}
// -onion can be used to set only a proxy for .onion, or override normal proxy for .onion addresses
@ -1382,7 +1382,7 @@ bool AppInitMain()
std : : string onionArg = gArgs . GetArg ( " -onion " , " " ) ;
if ( onionArg ! = " " ) {
if ( onionArg = = " 0 " ) { // Handle -noonion/-onion=0
SetLimited ( NET_ TOR ) ; // set onions as unreachable
SetLimited ( NET_ ONION ) ; // set onions as unreachable
} else {
CService onionProxy ;
if ( ! Lookup ( onionArg . c_str ( ) , onionProxy , 9050 , fNameLookup ) ) {
@ -1391,8 +1391,8 @@ bool AppInitMain()
proxyType addrOnion = proxyType ( onionProxy , proxyRandomize ) ;
if ( ! addrOnion . IsValid ( ) )
return InitError ( strprintf ( _ ( " Invalid -onion address or hostname: '%s' " ) , onionArg ) ) ;
SetProxy ( NET_ TOR , addrOnion ) ;
SetLimited ( NET_ TOR , false ) ;
SetProxy ( NET_ ONION , addrOnion ) ;
SetLimited ( NET_ ONION , false ) ;
}
}