aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
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.cpp
parent70ab73a0087cbb0d6b26c9ad58146ae542b1b9be (diff)
RPC: add 'getpeerinfo', returning easy-to-retrieve per-CNode data
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index f1073e0a3e..2a09d20dea 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -606,7 +606,23 @@ bool CNode::Misbehaving(int howmuch)
return false;
}
-
+#undef X
+#define X(name) stats.name = name
+void CNode::copyStats(CNodeStats &stats)
+{
+ X(nServices);
+ X(nLastSend);
+ X(nLastRecv);
+ X(nTimeConnected);
+ X(addrName);
+ X(nVersion);
+ X(strSubVer);
+ X(fInbound);
+ X(nReleaseTime);
+ X(nStartingHeight);
+ X(nMisbehavior);
+}
+#undef X