Skip to content

Commit 0eea83a

Browse files
committed
scripted-diff: rename proxyType to Proxy
-BEGIN VERIFY SCRIPT- sed -i 's/\<proxyType\>/Proxy/g' $(git grep -l proxyType) -END VERIFY SCRIPT-
1 parent e53a850 commit 0eea83a

File tree

10 files changed

+30
-30
lines changed

10 files changed

+30
-30
lines changed

src/init.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
13151315
// Check for host lookup allowed before parsing any network related parameters
13161316
fNameLookup = args.GetBoolArg("-dns", DEFAULT_NAME_LOOKUP);
13171317

1318-
proxyType onion_proxy;
1318+
Proxy onion_proxy;
13191319

13201320
bool proxyRandomize = args.GetBoolArg("-proxyrandomize", DEFAULT_PROXYRANDOMIZE);
13211321
// -proxy sets a proxy for all outgoing network traffic
@@ -1327,7 +1327,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
13271327
return InitError(strprintf(_("Invalid -proxy address or hostname: '%s'"), proxyArg));
13281328
}
13291329

1330-
proxyType addrProxy = proxyType(proxyAddr, proxyRandomize);
1330+
Proxy addrProxy = Proxy(proxyAddr, proxyRandomize);
13311331
if (!addrProxy.IsValid())
13321332
return InitError(strprintf(_("Invalid -proxy address or hostname: '%s'"), proxyArg));
13331333

@@ -1344,13 +1344,13 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
13441344
std::string onionArg = args.GetArg("-onion", "");
13451345
if (onionArg != "") {
13461346
if (onionArg == "0") { // Handle -noonion/-onion=0
1347-
onion_proxy = proxyType{};
1347+
onion_proxy = Proxy{};
13481348
} else {
13491349
CService addr;
13501350
if (!Lookup(onionArg, addr, 9050, fNameLookup) || !addr.IsValid()) {
13511351
return InitError(strprintf(_("Invalid -onion address or hostname: '%s'"), onionArg));
13521352
}
1353-
onion_proxy = proxyType{addr, proxyRandomize};
1353+
onion_proxy = Proxy{addr, proxyRandomize};
13541354
}
13551355
}
13561356

@@ -1851,7 +1851,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
18511851
if (!Lookup(i2psam_arg, addr, 7656, fNameLookup) || !addr.IsValid()) {
18521852
return InitError(strprintf(_("Invalid -i2psam address or hostname: '%s'"), i2psam_arg));
18531853
}
1854-
SetProxy(NET_I2P, proxyType{addr});
1854+
SetProxy(NET_I2P, Proxy{addr});
18551855
} else {
18561856
SetReachable(NET_I2P, false);
18571857
}

src/interfaces/node.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CNodeStats;
2828
class Coin;
2929
class RPCTimerInterface;
3030
class UniValue;
31-
class proxyType;
31+
class Proxy;
3232
enum class SynchronizationState;
3333
enum class TransactionError;
3434
struct CNodeStateStats;
@@ -97,7 +97,7 @@ class Node
9797
virtual void mapPort(bool use_upnp, bool use_natpmp) = 0;
9898

9999
//! Get proxy.
100-
virtual bool getProxy(Network net, proxyType& proxy_info) = 0;
100+
virtual bool getProxy(Network net, Proxy& proxy_info) = 0;
101101

102102
//! Get number of connections.
103103
virtual size_t getNodeCount(ConnectionDirection flags) = 0;

src/net.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCo
447447
// Connect
448448
bool connected = false;
449449
std::unique_ptr<Sock> sock;
450-
proxyType proxy;
450+
Proxy proxy;
451451
CAddress addr_bind;
452452
assert(!addr_bind.IsValid());
453453

@@ -2538,7 +2538,7 @@ bool CConnman::Start(CScheduler& scheduler, const Options& connOptions)
25382538
return false;
25392539
}
25402540

2541-
proxyType i2p_sam;
2541+
Proxy i2p_sam;
25422542
if (GetProxy(NET_I2P, i2p_sam)) {
25432543
m_i2p_sam_session = std::make_unique<i2p::sam::Session>(gArgs.GetDataDirNet() / "i2p_private_key",
25442544
i2p_sam.proxy, &interruptNet);

src/netbase.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131

3232
// Settings
3333
static Mutex g_proxyinfo_mutex;
34-
static proxyType proxyInfo[NET_MAX] GUARDED_BY(g_proxyinfo_mutex);
35-
static proxyType nameProxy GUARDED_BY(g_proxyinfo_mutex);
34+
static Proxy proxyInfo[NET_MAX] GUARDED_BY(g_proxyinfo_mutex);
35+
static Proxy nameProxy GUARDED_BY(g_proxyinfo_mutex);
3636
int nConnectTimeout = DEFAULT_CONNECT_TIMEOUT;
3737
bool fNameLookup = DEFAULT_NAME_LOOKUP;
3838

@@ -605,7 +605,7 @@ bool ConnectSocketDirectly(const CService &addrConnect, const Sock& sock, int nT
605605
return true;
606606
}
607607

608-
bool SetProxy(enum Network net, const proxyType &addrProxy) {
608+
bool SetProxy(enum Network net, const Proxy &addrProxy) {
609609
assert(net >= 0 && net < NET_MAX);
610610
if (!addrProxy.IsValid())
611611
return false;
@@ -614,7 +614,7 @@ bool SetProxy(enum Network net, const proxyType &addrProxy) {
614614
return true;
615615
}
616616

617-
bool GetProxy(enum Network net, proxyType &proxyInfoOut) {
617+
bool GetProxy(enum Network net, Proxy &proxyInfoOut) {
618618
assert(net >= 0 && net < NET_MAX);
619619
LOCK(g_proxyinfo_mutex);
620620
if (!proxyInfo[net].IsValid())
@@ -623,15 +623,15 @@ bool GetProxy(enum Network net, proxyType &proxyInfoOut) {
623623
return true;
624624
}
625625

626-
bool SetNameProxy(const proxyType &addrProxy) {
626+
bool SetNameProxy(const Proxy &addrProxy) {
627627
if (!addrProxy.IsValid())
628628
return false;
629629
LOCK(g_proxyinfo_mutex);
630630
nameProxy = addrProxy;
631631
return true;
632632
}
633633

634-
bool GetNameProxy(proxyType &nameProxyOut) {
634+
bool GetNameProxy(Proxy &nameProxyOut) {
635635
LOCK(g_proxyinfo_mutex);
636636
if(!nameProxy.IsValid())
637637
return false;
@@ -653,7 +653,7 @@ bool IsProxy(const CNetAddr &addr) {
653653
return false;
654654
}
655655

656-
bool ConnectThroughProxy(const proxyType& proxy, const std::string& strDest, uint16_t port, const Sock& sock, int nTimeout, bool& outProxyConnectionFailed)
656+
bool ConnectThroughProxy(const Proxy& proxy, const std::string& strDest, uint16_t port, const Sock& sock, int nTimeout, bool& outProxyConnectionFailed)
657657
{
658658
// first connect to proxy server
659659
if (!ConnectSocketDirectly(proxy.proxy, sock, nTimeout, true)) {

src/netbase.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ static inline bool operator&(ConnectionDirection a, ConnectionDirection b) {
4545
return (underlying(a) & underlying(b));
4646
}
4747

48-
class proxyType
48+
class Proxy
4949
{
5050
public:
51-
proxyType(): randomize_credentials(false) {}
52-
explicit proxyType(const CService &_proxy, bool _randomize_credentials=false): proxy(_proxy), randomize_credentials(_randomize_credentials) {}
51+
Proxy(): randomize_credentials(false) {}
52+
explicit Proxy(const CService &_proxy, bool _randomize_credentials=false): proxy(_proxy), randomize_credentials(_randomize_credentials) {}
5353

5454
bool IsValid() const { return proxy.IsValid(); }
5555

@@ -73,8 +73,8 @@ enum Network ParseNetwork(const std::string& net);
7373
std::string GetNetworkName(enum Network net);
7474
/** Return a vector of publicly routable Network names; optionally append NET_UNROUTABLE. */
7575
std::vector<std::string> GetNetworkNames(bool append_unroutable = false);
76-
bool SetProxy(enum Network net, const proxyType &addrProxy);
77-
bool GetProxy(enum Network net, proxyType &proxyInfoOut);
76+
bool SetProxy(enum Network net, const Proxy &addrProxy);
77+
bool GetProxy(enum Network net, Proxy &proxyInfoOut);
7878
bool IsProxy(const CNetAddr &addr);
7979
/**
8080
* Set the name proxy to use for all connections to nodes specified by a
@@ -92,9 +92,9 @@ bool IsProxy(const CNetAddr &addr);
9292
* server in common use (most notably Tor) actually implements UDP
9393
* support, and a DNS resolver is beyond the scope of this project.
9494
*/
95-
bool SetNameProxy(const proxyType &addrProxy);
95+
bool SetNameProxy(const Proxy &addrProxy);
9696
bool HaveNameProxy();
97-
bool GetNameProxy(proxyType &nameProxyOut);
97+
bool GetNameProxy(Proxy &nameProxyOut);
9898

9999
using DNSLookupFn = std::function<std::vector<CNetAddr>(const std::string&, bool)>;
100100
extern DNSLookupFn g_dns_lookup;
@@ -218,7 +218,7 @@ bool ConnectSocketDirectly(const CService &addrConnect, const Sock& sock, int nT
218218
*
219219
* @returns Whether or not the operation succeeded.
220220
*/
221-
bool ConnectThroughProxy(const proxyType& proxy, const std::string& strDest, uint16_t port, const Sock& sock, int nTimeout, bool& outProxyConnectionFailed);
221+
bool ConnectThroughProxy(const Proxy& proxy, const std::string& strDest, uint16_t port, const Sock& sock, int nTimeout, bool& outProxyConnectionFailed);
222222

223223
/** Disable or enable blocking-mode for a socket */
224224
bool SetSocketNonBlocking(const SOCKET& hSocket, bool fNonBlocking);

src/node/interfaces.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class NodeImpl : public Node
113113
}
114114
bool shutdownRequested() override { return ShutdownRequested(); }
115115
void mapPort(bool use_upnp, bool use_natpmp) override { StartMapPort(use_upnp, use_natpmp); }
116-
bool getProxy(Network net, proxyType& proxy_info) override { return GetProxy(net, proxy_info); }
116+
bool getProxy(Network net, Proxy& proxy_info) override { return GetProxy(net, proxy_info); }
117117
size_t getNodeCount(ConnectionDirection flags) override
118118
{
119119
return m_context->connman ? m_context->connman->GetNodeCount(flags) : 0;

src/qt/clientmodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ void ClientModel::unsubscribeFromCoreSignals()
328328

329329
bool ClientModel::getProxyInfo(std::string& ip_port) const
330330
{
331-
proxyType ipv4, ipv6;
331+
Proxy ipv4, ipv6;
332332
if (m_node.getProxy((Network) 1, ipv4) && m_node.getProxy((Network) 2, ipv6)) {
333333
ip_port = ipv4.proxy.ToStringIPPort();
334334
return true;

src/qt/optionsdialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ void OptionsDialog::updateProxyValidationState()
392392

393393
void OptionsDialog::updateDefaultProxyNets()
394394
{
395-
proxyType proxy;
395+
Proxy proxy;
396396
std::string strProxy;
397397
QString strDefaultProxyGUI;
398398

@@ -422,7 +422,7 @@ QValidator::State ProxyAddressValidator::validate(QString &input, int &pos) cons
422422
Q_UNUSED(pos);
423423
// Validate the proxy
424424
CService serv(LookupNumeric(input.toStdString(), DEFAULT_GUI_PROXY_PORT));
425-
proxyType addrProxy = proxyType(serv, true);
425+
Proxy addrProxy = Proxy(serv, true);
426426
if (addrProxy.IsValid())
427427
return QValidator::Acceptable;
428428

src/rpc/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ static UniValue GetNetworksInfo()
567567
for (int n = 0; n < NET_MAX; ++n) {
568568
enum Network network = static_cast<enum Network>(n);
569569
if (network == NET_UNROUTABLE || network == NET_INTERNAL) continue;
570-
proxyType proxy;
570+
Proxy proxy;
571571
UniValue obj(UniValue::VOBJ);
572572
GetProxy(network, proxy);
573573
obj.pushKV("name", GetNetworkName(network));

src/torcontrol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ void TorController::auth_cb(TorControlConnection& _conn, const TorControlReply&
378378
// if -onion isn't set to something else.
379379
if (gArgs.GetArg("-onion", "") == "") {
380380
CService resolved(LookupNumeric("127.0.0.1", 9050));
381-
proxyType addrOnion = proxyType(resolved, true);
381+
Proxy addrOnion = Proxy(resolved, true);
382382
SetProxy(NET_ONION, addrOnion);
383383

384384
const auto onlynets = gArgs.GetArgs("-onlynet");

0 commit comments

Comments
 (0)