aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-10-13 17:37:02 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2013-10-13 17:41:28 +0200
commit9269d0e96e621a6e02da8074785ac310ce64db73 (patch)
tree9707084615745ee0e8a929b220e3588cdaf47e9b /src/net.h
parentc74b6c3d8fcc1750fa0861ae851b353a7f3495d2 (diff)
parent971bb3e901aad5d4f04a651e3e2a75161d3a4e2a (diff)
Merge pull request #2937
971bb3e Added ping time measurement. New RPC "ping" command to request ping. Implemented "pong" message handler. New "pingtime" field in getpeerinfo, to provide results to user. New "pingwait" field, to show pings still in flight, to better see newly lagging peers. (Josh Lehan)
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index 49415f6502..b57f38fe3a 100644
--- a/src/net.h
+++ b/src/net.h
@@ -119,6 +119,8 @@ public:
uint64 nSendBytes;
uint64 nRecvBytes;
bool fSyncNode;
+ double dPingTime;
+ double dPingWait;
};
@@ -234,6 +236,12 @@ public:
CCriticalSection cs_inventory;
std::multimap<int64, CInv> mapAskFor;
+ // Ping time measurement
+ uint64 nPingNonceSent;
+ int64 nPingUsecStart;
+ int64 nPingUsecTime;
+ bool fPingQueued;
+
CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false) : ssSend(SER_NETWORK, MIN_PROTO_VERSION)
{
nServices = 0;
@@ -268,6 +276,10 @@ public:
fRelayTxes = false;
setInventoryKnown.max_size(SendBufferSize() / 1000);
pfilter = new CBloomFilter();
+ nPingNonceSent = 0;
+ nPingUsecStart = 0;
+ nPingUsecTime = 0;
+ fPingQueued = false;
// Be shy and don't send version until we hear
if (hSocket != INVALID_SOCKET && !fInbound)