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/net.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/net.cpp') diff --git a/src/net.cpp b/src/net.cpp index dd7bf283a9..d223b3999e 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -639,6 +639,9 @@ void CNode::copyStats(CNodeStats &stats) // Raw ping time is in microseconds, but show it to user as whole seconds (Bitcoin users should be well used to small numbers with many decimal places by now :) stats.dPingTime = (((double)nPingUsecTime) / 1e6); stats.dPingWait = (((double)nPingUsecWait) / 1e6); + + // Leave string empty if addrLocal invalid (not filled in yet) + stats.addrLocal = addrLocal.IsValid() ? addrLocal.ToString() : ""; } #undef X -- cgit v1.2.3