mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
RPC: add 'getpeerinfo', returning easy-to-retrieve per-CNode data
This commit is contained in:
18
src/net.cpp
18
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
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user