RPC: add 'getpeerinfo', returning easy-to-retrieve per-CNode data

This commit is contained in:
Jeff Garzik
2012-06-29 17:24:53 -04:00
committed by Jeff Garzik
parent 70ab73a008
commit 1006f0707e
4 changed files with 84 additions and 1 deletions

View File

@@ -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