aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorScott Ellis <sje397@gmail.com>2013-08-23 02:09:32 +1000
committerScott Ellis <sje397@gmail.com>2013-10-14 19:02:03 +1100
commitce14345a89dfa05992f8d2c7c9fe36315d4a67e6 (patch)
tree997e08222a82558e8720fa0ce0ba82438f161664 /src/net.h
parent9269d0e96e621a6e02da8074785ac310ce64db73 (diff)
downloadbitcoin-ce14345a89dfa05992f8d2c7c9fe36315d4a67e6.tar.xz
Add network traffic graph
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index b57f38fe3a..ab1b69acb7 100644
--- a/src/net.h
+++ b/src/net.h
@@ -298,8 +298,15 @@ public:
}
private:
+ // Network usage totals
+ static CCriticalSection cs_totalBytesRecv;
+ static CCriticalSection cs_totalBytesSent;
+ static uint64 nTotalBytesRecv;
+ static uint64 nTotalBytesSent;
+
CNode(const CNode&);
void operator=(const CNode&);
+
public:
@@ -646,6 +653,13 @@ public:
static bool IsBanned(CNetAddr ip);
bool Misbehaving(int howmuch); // 1 == a little, 100 == a lot
void copyStats(CNodeStats &stats);
+
+ // Network stats
+ static void RecordBytesRecv(uint64 bytes);
+ static void RecordBytesSent(uint64 bytes);
+
+ static uint64 GetTotalBytesRecv();
+ static uint64 GetTotalBytesSent();
};