MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / GetNetworksInfo

Function GetNetworksInfo

src/rpc/net.cpp:395–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395static UniValue GetNetworksInfo()
396{
397 UniValue networks(UniValue::VARR);
398 for(int n=0; n<NET_MAX; ++n)
399 {
400 enum Network network = static_cast<enum Network>(n);
401 if(network == NET_UNROUTABLE || network == NET_INTERNAL)
402 continue;
403 proxyType proxy;
404 UniValue obj(UniValue::VOBJ);
405 GetProxy(network, proxy);
406 obj.pushKV("name", GetNetworkName(network));
407 obj.pushKV("limited", IsLimited(network));
408 obj.pushKV("reachable", IsReachable(network));
409 obj.pushKV("proxy", proxy.IsValid() ? proxy.proxy.ToStringIPPort() : std::string());
410 obj.pushKV("proxy_randomize_credentials", proxy.randomize_credentials);
411 networks.push_back(obj);
412 }
413 return networks;
414}
415
416static UniValue getnetworkinfo(const JSONRPCRequest& request)
417{

Callers 1

getnetworkinfoFunction · 0.85

Calls 8

GetProxyFunction · 0.85
GetNetworkNameFunction · 0.85
IsLimitedFunction · 0.85
IsReachableFunction · 0.85
ToStringIPPortMethod · 0.80
pushKVMethod · 0.45
IsValidMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected