MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ResolveIP

Function ResolveIP

src/test/addrman_tests.cpp:38–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38static CNetAddr ResolveIP(const std::string& ip)
39{
40 const std::optional<CNetAddr> addr{LookupHost(ip, false)};
41 BOOST_CHECK_MESSAGE(addr.has_value(), strprintf("failed to resolve: %s", ip));
42 return addr.value_or(CNetAddr{});
43}
44
45static CService ResolveService(const std::string& ip, uint16_t port = 0)
46{

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.70

Calls 3

LookupHostFunction · 0.85
has_valueMethod · 0.45
value_orMethod · 0.45

Tested by

no test coverage detected