mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Add -keepnode which attempts to -addnode and keep a connection open
This commit is contained in:
@@ -96,7 +96,7 @@ bool LookupHostNumeric(const char *pszName, std::vector<CNetAddr>& vIP, int nMax
|
||||
return LookupHost(pszName, vIP, nMaxSolutions, false);
|
||||
}
|
||||
|
||||
bool Lookup(const char *pszName, CService& addr, int portDefault, bool fAllowLookup)
|
||||
bool Lookup(const char *pszName, std::vector<CService>& vAddr, int portDefault, bool fAllowLookup, int nMaxSolutions)
|
||||
{
|
||||
if (pszName[0] == 0)
|
||||
return false;
|
||||
@@ -130,10 +130,22 @@ bool Lookup(const char *pszName, CService& addr, int portDefault, bool fAllowLoo
|
||||
}
|
||||
|
||||
std::vector<CNetAddr> vIP;
|
||||
bool fRet = LookupIntern(pszHost, vIP, 1, fAllowLookup);
|
||||
bool fRet = LookupIntern(pszHost, vIP, nMaxSolutions, fAllowLookup);
|
||||
if (!fRet)
|
||||
return false;
|
||||
addr = CService(vIP[0], port);
|
||||
vAddr.resize(vIP.size());
|
||||
for (int i = 0; i < vIP.size(); i++)
|
||||
vAddr[i] = CService(vIP[i], port);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Lookup(const char *pszName, CService& addr, int portDefault, bool fAllowLookup)
|
||||
{
|
||||
std::vector<CService> vService;
|
||||
bool fRet = Lookup(pszName, vService, portDefault, fAllowLookup, 1);
|
||||
if (!fRet)
|
||||
return false;
|
||||
addr = vService[0];
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user