aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2012-06-29 17:24:53 -0400
committerJeff Garzik <jgarzik@redhat.com>2012-06-29 17:24:53 -0400
commit1006f0707e34f8903f247195dabd86243ae61f05 (patch)
treecc1539a2e0d8fe72e3545c617d0bc1a9e34c0330 /src/net.h
parent70ab73a0087cbb0d6b26c9ad58146ae542b1b9be (diff)
RPC: add 'getpeerinfo', returning easy-to-retrieve per-CNode data
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index fa6f700867..21ecaef848 100644
--- a/src/net.h
+++ b/src/net.h
@@ -128,6 +128,24 @@ extern std::map<CInv, int64> mapAlreadyAskedFor;
+class CNodeStats
+{
+public:
+ uint64 nServices;
+ int64 nLastSend;
+ int64 nLastRecv;
+ int64 nTimeConnected;
+ std::string addrName;
+ int nVersion;
+ std::string strSubVer;
+ bool fInbound;
+ int64 nReleaseTime;
+ int nStartingHeight;
+ int nMisbehavior;
+};
+
+
+
/** Information about a peer */
@@ -617,6 +635,7 @@ public:
static void ClearBanned(); // needed for unit testing
static bool IsBanned(CNetAddr ip);
bool Misbehaving(int howmuch); // 1 == a little, 100 == a lot
+ void copyStats(CNodeStats &stats);
};