diff options
| author | Gavin Andresen <[email protected]> | 2013-12-08 23:33:24 -0800 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2013-12-08 23:33:24 -0800 |
| commit | 7202d9d9bf6e7442ea8e945b271dcec079ff5239 (patch) | |
| tree | e34d33bf5a9309ce4e60ba1e1889a5bf1b6c7beb /src/rpcnet.cpp | |
| parent | Merge pull request #3348 (diff) | |
| parent | Add main-specific node state (diff) | |
| download | discoin-7202d9d9bf6e7442ea8e945b271dcec079ff5239.tar.xz discoin-7202d9d9bf6e7442ea8e945b271dcec079ff5239.zip | |
Merge pull request #3276 from sipa/nodestate
Add main-specific node state & move ban score
Diffstat (limited to 'src/rpcnet.cpp')
| -rw-r--r-- | src/rpcnet.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index baa3268fb..93811e80e 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -2,6 +2,9 @@ // Distributed under the MIT/X11 software license, see the accompanying // 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" @@ -114,7 +117,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)); @@ -134,7 +138,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)); |