diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2013-04-07 19:31:13 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2013-04-07 19:31:13 +0200 |
commit | 86648a8d16699ab392508a48bb867d3fc4f7d6cf (patch) | |
tree | 8791097b76870c494c545a036368c5673ae48efe /src/net.cpp | |
parent | 6ed71b5e4faa2ea6d739eefa9c3dcc15db80439c (diff) |
Add bytessent, bytesrecv and syncnode to getpeerinfo
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/net.cpp b/src/net.cpp index 4727f1e2e6..ccacb0b291 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -619,6 +619,9 @@ void CNode::copyStats(CNodeStats &stats) X(nReleaseTime); X(nStartingHeight); X(nMisbehavior); + X(nSendBytes); + X(nRecvBytes); + stats.fSyncNode = (this == pnodeSync); } #undef X @@ -713,6 +716,7 @@ void SocketSendData(CNode *pnode) int nBytes = send(pnode->hSocket, &data[pnode->nSendOffset], data.size() - pnode->nSendOffset, MSG_NOSIGNAL | MSG_DONTWAIT); if (nBytes > 0) { pnode->nLastSend = GetTime(); + pnode->nSendBytes += nBytes; pnode->nSendOffset += nBytes; if (pnode->nSendOffset == data.size()) { pnode->nSendOffset = 0; @@ -976,6 +980,7 @@ void ThreadSocketHandler() if (!pnode->ReceiveMsgBytes(pchBuf, nBytes)) pnode->CloseSocketDisconnect(); pnode->nLastRecv = GetTime(); + pnode->nRecvBytes += nBytes; } else if (nBytes == 0) { |