| 228 | } |
| 229 | |
| 230 | CService LookupNumeric(const std::string& name, uint16_t portDefault, DNSLookupFn dns_lookup_function) |
| 231 | { |
| 232 | if (!ValidAsCString(name)) { |
| 233 | return {}; |
| 234 | } |
| 235 | CService addr; |
| 236 | // "1.2:345" will fail to resolve the ip, but will still set the port. |
| 237 | // If the ip fails to resolve, re-init the result. |
| 238 | if(!Lookup(name, addr, portDefault, false, dns_lookup_function)) |
| 239 | addr = CService(); |
| 240 | return addr; |
| 241 | } |
| 242 | |
| 243 | /** SOCKS version */ |
| 244 | enum SOCKSVersion: uint8_t { |