| 136 | } |
| 137 | |
| 138 | bool Lookup(const char* pszName, vector<CService>& vAddr, int portDefault, bool fAllowLookup, |
| 139 | unsigned int nMaxSolutions) { |
| 140 | if (pszName[0] == 0) |
| 141 | return false; |
| 142 | int port = portDefault; |
| 143 | string hostname = ""; |
| 144 | SplitHostPort(string(pszName), port, hostname); |
| 145 | |
| 146 | vector<CNetAddr> vIP; |
| 147 | bool fRet = LookupIntern(hostname.c_str(), vIP, nMaxSolutions, fAllowLookup); |
| 148 | if (!fRet) |
| 149 | return false; |
| 150 | vAddr.resize(vIP.size()); |
| 151 | for (unsigned int i = 0; i < vIP.size(); i++) vAddr[i] = CService(vIP[i], port); |
| 152 | return true; |
| 153 | } |
| 154 | |
| 155 | bool Lookup(const char* pszName, CService& addr, int portDefault, bool fAllowLookup) { |
| 156 | vector<CService> vService; |