Skip to content

Commit 644f123

Browse files
committed
Make nTimeConnected const in CNode
1 parent 321d0fc commit 644f123

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2574,6 +2574,7 @@ unsigned int CConnman::GetReceiveFloodSize() const { return nReceiveFloodSize; }
25742574
unsigned int CConnman::GetSendBufferSize() const{ return nSendBufferMaxSize; }
25752575

25762576
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) :
2577+
nTimeConnected(GetSystemTimeInSeconds()),
25772578
addr(addrIn),
25782579
fInbound(fInboundIn),
25792580
id(idIn),
@@ -2593,7 +2594,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
25932594
nLastRecv = 0;
25942595
nSendBytes = 0;
25952596
nRecvBytes = 0;
2596-
nTimeConnected = GetSystemTimeInSeconds();
25972597
nTimeOffset = 0;
25982598
addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn;
25992599
nVersion = 0;

src/net.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ class CNode
587587

588588
std::atomic<int64_t> nLastSend;
589589
std::atomic<int64_t> nLastRecv;
590-
int64_t nTimeConnected;
590+
const int64_t nTimeConnected;
591591
std::atomic<int64_t> nTimeOffset;
592592
const CAddress addr;
593593
std::string addrName;

0 commit comments

Comments
 (0)