From a4807d9b2a9839ce02dc050d7616d85598b87c09 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Thu, 24 Dec 2015 13:42:44 -0200 Subject: [PATCH] report external ports in getinfo --- src/rpcwallet.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 254aae06..471e24da 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -69,7 +69,7 @@ Value getinfo(const Array& params, bool fHelp) "Returns an object containing various state info."); proxyType proxy; - GetProxy(NET_IPV4, proxy); + bool usingProxy = GetProxy(NET_IPV4, proxy); Object obj; 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_global_nodes", dht_global_nodes)); 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); obj.push_back(Pair("difficulty", (double)GetDifficulty()));