aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp5
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)
{