| 196 | } |
| 197 | |
| 198 | bool Lookup(const std::string& name, std::vector<CService>& vAddr, uint16_t portDefault, bool fAllowLookup, unsigned int nMaxSolutions, DNSLookupFn dns_lookup_function) |
| 199 | { |
| 200 | if (name.empty() || !ValidAsCString(name)) { |
| 201 | return false; |
| 202 | } |
| 203 | uint16_t port{portDefault}; |
| 204 | std::string hostname; |
| 205 | SplitHostPort(name, port, hostname); |
| 206 | |
| 207 | std::vector<CNetAddr> vIP; |
| 208 | bool fRet = LookupIntern(hostname, vIP, nMaxSolutions, fAllowLookup, dns_lookup_function); |
| 209 | if (!fRet) |
| 210 | return false; |
| 211 | vAddr.resize(vIP.size()); |
| 212 | for (unsigned int i = 0; i < vIP.size(); i++) |
| 213 | vAddr[i] = CService(vIP[i], port); |
| 214 | return true; |
| 215 | } |
| 216 | |
| 217 | bool Lookup(const std::string& name, CService& addr, uint16_t portDefault, bool fAllowLookup, DNSLookupFn dns_lookup_function) |
| 218 | { |