refactor: Use NodeClock::time_point for CNetMessage::m_time

The field is not a duration, but a time point.

This will add two temporary calls to time_since_epoch(), which are fixed
in the next commit.
This commit is contained in:
MarcoFalke
2026-03-20 13:23:30 +01:00
parent fa644e625b
commit fa2605b204
4 changed files with 15 additions and 14 deletions

View File

@@ -553,7 +553,7 @@ public:
ServiceFlags GetDesirableServiceFlags(ServiceFlags services) const override;
private:
void ProcessMessage(Peer& peer, CNode& pfrom, const std::string& msg_type, DataStream& vRecv, std::chrono::microseconds time_received,
void ProcessMessage(Peer& peer, CNode& pfrom, const std::string& msg_type, DataStream& vRecv, NodeClock::time_point time_received,
const std::atomic<bool>& interruptMsgProc)
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, !m_most_recent_block_mutex, !m_headers_presync_mutex, g_msgproc_mutex, !m_tx_download_mutex);
@@ -3570,7 +3570,7 @@ void PeerManagerImpl::PushPrivateBroadcastTx(CNode& node)
}
void PeerManagerImpl::ProcessMessage(Peer& peer, CNode& pfrom, const std::string& msg_type, DataStream& vRecv,
const std::chrono::microseconds time_received,
const NodeClock::time_point time_received,
const std::atomic<bool>& interruptMsgProc)
{
AssertLockHeld(g_msgproc_mutex);
@@ -4900,7 +4900,7 @@ void PeerManagerImpl::ProcessMessage(Peer& peer, CNode& pfrom, const std::string
}
if (msg_type == NetMsgType::PONG) {
const auto ping_end = time_received;
const auto ping_end{time_received.time_since_epoch()};
uint64_t nonce = 0;
size_t nAvail = vRecv.in_avail();
bool bPingFinished = false;