Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/net.cpp
Show First 20 Lines • Show All 488 Lines • ▼ Show 20 Lines | for (int n = 0; n < NET_MAX; ++n) { | ||||
continue; | continue; | ||||
} | } | ||||
proxyType proxy; | proxyType proxy; | ||||
UniValue obj(UniValue::VOBJ); | UniValue obj(UniValue::VOBJ); | ||||
GetProxy(network, proxy); | GetProxy(network, proxy); | ||||
obj.pushKV("name", GetNetworkName(network)); | obj.pushKV("name", GetNetworkName(network)); | ||||
obj.pushKV("limited", IsLimited(network)); | obj.pushKV("limited", IsLimited(network)); | ||||
obj.pushKV("reachable", IsReachable(network)); | obj.pushKV("reachable", IsReachable(network)); | ||||
obj.pushKV("proxy", | obj.pushKV("proxy", proxy.IsValid() ? proxy.proxy.ToStringIPPort() | ||||
proxy.IsValid() ? proxy.proxy.ToStringIPPort() | |||||
: std::string()); | : std::string()); | ||||
obj.pushKV("proxy_randomize_credentials", proxy.randomize_credentials); | obj.pushKV("proxy_randomize_credentials", proxy.randomize_credentials); | ||||
networks.push_back(obj); | networks.push_back(obj); | ||||
} | } | ||||
return networks; | return networks; | ||||
} | } | ||||
static UniValue getnetworkinfo(const Config &config, | static UniValue getnetworkinfo(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
Show All 37 Lines | if (request.fHelp || request.params.size() != 0) { | ||||
" ,...\n" | " ,...\n" | ||||
" ],\n" | " ],\n" | ||||
" \"relayfee\": x.xxxxxxxx, (numeric) minimum " | " \"relayfee\": x.xxxxxxxx, (numeric) minimum " | ||||
"relay fee for non-free transactions in " + | "relay fee for non-free transactions in " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
"/kB\n" | "/kB\n" | ||||
" \"excessutxocharge\": x.xxxxxxxx, (numeric) minimum " | " \"excessutxocharge\": x.xxxxxxxx, (numeric) minimum " | ||||
"charge for excess utxos in " + | "charge for excess utxos in " + | ||||
CURRENCY_UNIT + "\n" | CURRENCY_UNIT + | ||||
"\n" | |||||
" \"localaddresses\": [ " | " \"localaddresses\": [ " | ||||
"(array) list of local addresses\n" | "(array) list of local addresses\n" | ||||
" {\n" | " {\n" | ||||
" \"address\": \"xxxx\", " | " \"address\": \"xxxx\", " | ||||
"(string) network address\n" | "(string) network address\n" | ||||
" \"port\": xxx, " | " \"port\": xxx, " | ||||
"(numeric) network port\n" | "(numeric) network port\n" | ||||
" \"score\": xxx " | " \"score\": xxx " | ||||
"(numeric) relative score\n" | "(numeric) relative score\n" | ||||
" }\n" | " }\n" | ||||
" ,...\n" | " ,...\n" | ||||
" ]\n" | " ]\n" | ||||
" \"warnings\": \"...\" " | " \"warnings\": \"...\" " | ||||
"(string) any network warnings\n" | "(string) any network warnings\n" | ||||
"}\n" | "}\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("getnetworkinfo", "") + | HelpExampleCli("getnetworkinfo", "") + | ||||
HelpExampleRpc("getnetworkinfo", "")); | HelpExampleRpc("getnetworkinfo", "")); | ||||
} | } | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
UniValue obj(UniValue::VOBJ); | UniValue obj(UniValue::VOBJ); | ||||
obj.pushKV("version", CLIENT_VERSION); | obj.pushKV("version", CLIENT_VERSION); | ||||
obj.pushKV("subversion", userAgent(config)); | obj.pushKV("subversion", userAgent(config)); | ||||
▲ Show 20 Lines • Show All 223 Lines • Show Last 20 Lines |