From 547c61f8d8b42296fd0a51bad4a2e3a3765aa7fd Mon Sep 17 00:00:00 2001 From: Josh Lehan Date: Wed, 21 Aug 2013 22:50:19 -0700 Subject: Adding new "addrlocal" field to RPC getpeerinfo. The existing CNode::addrLocal member is revealed to the user, as an address string, similar to the existing "addr" field. Instead of showing garbage or empty string, it simply will not appear in the output if local address not known yet. --- src/rpcnet.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/rpcnet.cpp') diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 7685dec57b..3c92739852 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -66,6 +66,8 @@ Value getpeerinfo(const Array& params, bool fHelp) Object obj; obj.push_back(Pair("addr", stats.addrName)); + if (!(stats.addrLocal.empty())) + obj.push_back(Pair("addrlocal", stats.addrLocal)); obj.push_back(Pair("services", strprintf("%08"PRI64x, stats.nServices))); obj.push_back(Pair("lastsend", (boost::int64_t)stats.nLastSend)); obj.push_back(Pair("lastrecv", (boost::int64_t)stats.nLastRecv)); -- cgit v1.2.3