diff options
Diffstat (limited to 'src/rpcnet.cpp')
| -rw-r--r-- | src/rpcnet.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index b492b57de..06ae7070c 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -3,11 +3,17 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "rpcserver.h" + +#include "main.h" #include "net.h" #include "netbase.h" #include "protocol.h" #include "sync.h" #include "util.h" +#ifdef ENABLE_WALLET +#include "init.h" // for getinfo +#include "wallet.h" // for getinfo +#endif #include <inttypes.h> @@ -110,7 +116,8 @@ Value getpeerinfo(const Array& params, bool fHelp) BOOST_FOREACH(const CNodeStats& stats, vstats) { Object obj; - + CNodeStateStats statestats; + bool fStateStats = GetNodeStateStats(stats.nodeid, statestats); obj.push_back(Pair("addr", stats.addrName)); if (!(stats.addrLocal.empty())) obj.push_back(Pair("addrlocal", stats.addrLocal)); @@ -130,7 +137,9 @@ Value getpeerinfo(const Array& params, bool fHelp) obj.push_back(Pair("subver", stats.cleanSubVer)); obj.push_back(Pair("inbound", stats.fInbound)); obj.push_back(Pair("startingheight", stats.nStartingHeight)); - obj.push_back(Pair("banscore", stats.nMisbehavior)); + if (fStateStats) { + obj.push_back(Pair("banscore", statestats.nMisbehavior)); + } if (stats.fSyncNode) obj.push_back(Pair("syncnode", true)); |