@@ -386,7 +386,7 @@ class PeerManagerImpl final : public PeerManager
386
386
EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
387
387
388
388
/* * Send a version message to a peer */
389
- void PushNodeVersion (CNode& pnode, int64_t nTime );
389
+ void PushNodeVersion (CNode& pnode);
390
390
391
391
/* * Send a ping message every PING_INTERVAL or if requested via RPC. May
392
392
* mark the peer to be disconnected if a ping has timed out.
@@ -1090,12 +1090,13 @@ void PeerManagerImpl::FindNextBlocksToDownload(NodeId nodeid, unsigned int count
1090
1090
1091
1091
} // namespace
1092
1092
1093
- void PeerManagerImpl::PushNodeVersion (CNode& pnode, int64_t nTime )
1093
+ void PeerManagerImpl::PushNodeVersion (CNode& pnode)
1094
1094
{
1095
1095
// Note that pnode->GetLocalServices() is a reflection of the local
1096
1096
// services we were offering when the CNode object was created for this
1097
1097
// peer.
1098
1098
uint64_t my_services{pnode.GetLocalServices ()};
1099
+ const int64_t nTime{count_seconds (GetTime<std::chrono::seconds>())};
1099
1100
uint64_t nonce = pnode.GetLocalNonce ();
1100
1101
const int nNodeStartingHeight{m_best_height};
1101
1102
NodeId nodeid = pnode.GetId ();
@@ -1167,7 +1168,7 @@ void PeerManagerImpl::InitializeNode(CNode *pnode)
1167
1168
m_peer_map.emplace_hint (m_peer_map.end (), nodeid, std::move (peer));
1168
1169
}
1169
1170
if (!pnode->IsInboundConn ()) {
1170
- PushNodeVersion (*pnode, GetTime () );
1171
+ PushNodeVersion (*pnode);
1171
1172
}
1172
1173
}
1173
1174
@@ -2599,7 +2600,9 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
2599
2600
2600
2601
// Inbound peers send us their version message when they connect.
2601
2602
// We send our version message in response.
2602
- if (pfrom.IsInboundConn ()) PushNodeVersion (pfrom, GetAdjustedTime ());
2603
+ if (pfrom.IsInboundConn ()) {
2604
+ PushNodeVersion (pfrom);
2605
+ }
2603
2606
2604
2607
// Change version
2605
2608
const int greatest_common_version = std::min (nVersion, PROTOCOL_VERSION);
0 commit comments