mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-22 20:44:56 +00:00
report external ports in getinfo
This commit is contained in:
parent
10079adfde
commit
a4807d9b2a
@ -69,7 +69,7 @@ Value getinfo(const Array& params, bool fHelp)
|
|||||||
"Returns an object containing various state info.");
|
"Returns an object containing various state info.");
|
||||||
|
|
||||||
proxyType proxy;
|
proxyType proxy;
|
||||||
GetProxy(NET_IPV4, proxy);
|
bool usingProxy = GetProxy(NET_IPV4, proxy);
|
||||||
|
|
||||||
Object obj;
|
Object obj;
|
||||||
obj.push_back(Pair("version", (int)CLIENT_VERSION));
|
obj.push_back(Pair("version", (int)CLIENT_VERSION));
|
||||||
@ -87,6 +87,10 @@ Value getinfo(const Array& params, bool fHelp)
|
|||||||
obj.push_back(Pair("dht_nodes", getDhtNodes(&dht_global_nodes)));
|
obj.push_back(Pair("dht_nodes", getDhtNodes(&dht_global_nodes)));
|
||||||
obj.push_back(Pair("dht_global_nodes", dht_global_nodes));
|
obj.push_back(Pair("dht_global_nodes", dht_global_nodes));
|
||||||
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
|
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
|
||||||
|
if( !usingProxy ) {
|
||||||
|
obj.push_back(Pair("ext_port1", GetListenPort()));
|
||||||
|
obj.push_back(Pair("ext_port2", GetListenPort()+LIBTORRENT_PORT_OFFSET));
|
||||||
|
}
|
||||||
{
|
{
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
|
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user