mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
net: Split resolving out of CService
This commit is contained in:
@@ -639,7 +639,7 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest
|
||||
}
|
||||
}
|
||||
|
||||
addr = CService("0.0.0.0:0");
|
||||
addr = CService();
|
||||
|
||||
if (!HaveNameProxy())
|
||||
return false;
|
||||
@@ -1124,38 +1124,6 @@ bool CService::SetSockAddr(const struct sockaddr *paddr)
|
||||
}
|
||||
}
|
||||
|
||||
CService::CService(const char *pszIpPort)
|
||||
{
|
||||
Init();
|
||||
CService ip;
|
||||
if (Lookup(pszIpPort, ip, 0, false))
|
||||
*this = ip;
|
||||
}
|
||||
|
||||
CService::CService(const char *pszIpPort, int portDefault)
|
||||
{
|
||||
Init();
|
||||
CService ip;
|
||||
if (Lookup(pszIpPort, ip, portDefault, false))
|
||||
*this = ip;
|
||||
}
|
||||
|
||||
CService::CService(const std::string &strIpPort)
|
||||
{
|
||||
Init();
|
||||
CService ip;
|
||||
if (Lookup(strIpPort.c_str(), ip, 0, false))
|
||||
*this = ip;
|
||||
}
|
||||
|
||||
CService::CService(const std::string &strIpPort, int portDefault)
|
||||
{
|
||||
Init();
|
||||
CService ip;
|
||||
if (Lookup(strIpPort.c_str(), ip, portDefault, false))
|
||||
*this = ip;
|
||||
}
|
||||
|
||||
unsigned short CService::GetPort() const
|
||||
{
|
||||
return port;
|
||||
|
||||
Reference in New Issue
Block a user