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

Function MaybeFlipIPv6toCJDNS

src/net.cpp:277–284  ·  view source on GitHub ↗

* If an IPv6 address belongs to the address range used by the CJDNS network and * the CJDNS network is reachable (-cjdnsreachable config is set), then change * the type from NET_IPV6 to NET_CJDNS. * @param[in] service Address to potentially convert. * @return a copy of `service` either unmodified or changed to CJDNS. */

Source from the content-addressed store, hash-verified

275 * @return a copy of `service` either unmodified or changed to CJDNS.
276 */
277CService MaybeFlipIPv6toCJDNS(const CService& service)
278{
279 CService ret{service};
280 if (ret.m_net == NET_IPV6 && ret.m_addr[0] == 0xfc && IsReachable(NET_CJDNS)) {
281 ret.m_net = NET_CJDNS;
282 }
283 return ret;
284}
285
286// learn a new local address
287bool AddLocal(const CService& addr_, int nScore)

Callers 5

AddLocalFunction · 0.85
ConnectNodeMethod · 0.85
AcceptConnectionMethod · 0.85
GetAddedNodeInfoMethod · 0.85
BindMethod · 0.85

Calls 1

IsReachableFunction · 0.85

Tested by

no test coverage detected