mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-10 06:39:15 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user