MCPcopy Create free account
hub / github.com/ElementsProject/elements / Lookup

Function Lookup

src/netbase.cpp:198–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198bool 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
217bool Lookup(const std::string& name, CService& addr, uint16_t portDefault, bool fAllowLookup, DNSLookupFn dns_lookup_function)
218{

Callers 11

ConnectMethod · 0.85
LookupNumericFunction · 0.85
AppInitMainFunction · 0.85
TryParseMethod · 0.85
GetListenPortFunction · 0.85
ConnectNodeMethod · 0.85
ResolveServiceFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
MakeCorruptPeersDatFunction · 0.85
FUZZ_TARGETFunction · 0.85
TESTFunction · 0.85

Calls 7

ValidAsCStringFunction · 0.85
SplitHostPortFunction · 0.85
LookupInternFunction · 0.85
CServiceClass · 0.70
emptyMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45

Tested by 5

ResolveServiceFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
MakeCorruptPeersDatFunction · 0.68
FUZZ_TARGETFunction · 0.68
TESTFunction · 0.68