From 644f1234e22626a7b5618a1dae60a8457a4063b1 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 6 Feb 2017 11:42:49 -0500 Subject: Make nTimeConnected const in CNode --- src/net.cpp | 2 +- src/net.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/net.cpp b/src/net.cpp index c96ca469ff..0e6e00d58b 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2574,6 +2574,7 @@ unsigned int CConnman::GetReceiveFloodSize() const { return nReceiveFloodSize; } unsigned int CConnman::GetSendBufferSize() const{ return nSendBufferMaxSize; } CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress& addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const std::string& addrNameIn, bool fInboundIn) : + nTimeConnected(GetSystemTimeInSeconds()), addr(addrIn), fInbound(fInboundIn), id(idIn), @@ -2593,7 +2594,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn nLastRecv = 0; nSendBytes = 0; nRecvBytes = 0; - nTimeConnected = GetSystemTimeInSeconds(); nTimeOffset = 0; addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn; nVersion = 0; diff --git a/src/net.h b/src/net.h index 89501c764e..4bbcfac88b 100644 --- a/src/net.h +++ b/src/net.h @@ -587,7 +587,7 @@ public: std::atomic nLastSend; std::atomic nLastRecv; - int64_t nTimeConnected; + const int64_t nTimeConnected; std::atomic nTimeOffset; const CAddress addr; std::string addrName; -- cgit v1.2.3