mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 14:40:12 +01:00
net: move IsReachable() code to netbase and encapsulate it
`vfLimited`, `IsReachable()`, `SetReachable()` need not be in the `net` module. Move them to `netbase` because they will be needed in `LookupSubNet()` to possibly flip the result to CJDNS (if that network is reachable). In the process, encapsulate them in a class. `NET_UNROUTABLE` and `NET_INTERNAL` are no longer ignored when adding or removing reachable networks. This was unnecessary.
This commit is contained in:
@@ -585,8 +585,8 @@ static UniValue GetNetworksInfo()
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
GetProxy(network, proxy);
|
||||
obj.pushKV("name", GetNetworkName(network));
|
||||
obj.pushKV("limited", !IsReachable(network));
|
||||
obj.pushKV("reachable", IsReachable(network));
|
||||
obj.pushKV("limited", !g_reachable_nets.Contains(network));
|
||||
obj.pushKV("reachable", g_reachable_nets.Contains(network));
|
||||
obj.pushKV("proxy", proxy.IsValid() ? proxy.proxy.ToStringAddrPort() : std::string());
|
||||
obj.pushKV("proxy_randomize_credentials", proxy.randomize_credentials);
|
||||
networks.push_back(obj);
|
||||
|
||||
Reference in New Issue
Block a user