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

Method PCPTestingSetup

src/test/pcp_tests.cpp:43–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41{
42public:
43 explicit PCPTestingSetup(const ChainType chainType = ChainType::MAIN,
44 TestOpts opts = {})
45 : BasicTestingSetup{chainType, opts},
46 m_create_sock_orig{CreateSock}
47 {
48 const std::optional<CService> local_ipv4{Lookup("192.168.0.6", 1, false)};
49 const std::optional<CService> local_ipv6{Lookup("2a10:1234:5678:9abc:def0:1234:5678:9abc", 1, false)};
50 const std::optional<CService> gateway_ipv4{Lookup("192.168.0.1", 1, false)};
51 const std::optional<CService> gateway_ipv6{Lookup("2a10:1234:5678:9abc:def0:0000:0000:0000", 1, false)};
52 BOOST_REQUIRE(local_ipv4 && local_ipv6 && gateway_ipv4 && gateway_ipv6);
53 default_local_ipv4 = *local_ipv4;
54 default_local_ipv6 = *local_ipv6;
55 default_gateway_ipv4 = *gateway_ipv4;
56 default_gateway_ipv6 = *gateway_ipv6;
57
58 struct in_addr inaddr_any;
59 inaddr_any.s_addr = htonl(INADDR_ANY);
60 bind_any_ipv4 = CNetAddr(inaddr_any);
61 }
62
63 ~PCPTestingSetup()
64 {

Callers

nothing calls this directly

Calls 2

LookupFunction · 0.85
CNetAddrClass · 0.85

Tested by

no test coverage detected