aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-10-22 11:06:23 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-11-17 08:45:17 +0100
commitfa6d5a238d2c94440105ddd4f1554f85659d6c5b (patch)
treec5e9a51f35af0982da10779ff5ed8e265ab5ac3c /src/net.cpp
parent398fd63356db9023665396c371d67a8c76edeb4d (diff)
downloadbitcoin-fa6d5a238d2c94440105ddd4f1554f85659d6c5b.tar.xz
scripted-diff: Rename m_last_send and m_last_recv
-BEGIN VERIFY SCRIPT- ren() { sed -i "s/\<$1\>/$2/g" $(git grep -l "$1" ./src) ; } ren nLastSend m_last_send ren nLastRecv m_last_recv -END VERIFY SCRIPT-
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 82e55d4189..767b0e1a82 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -585,8 +585,8 @@ void CNode::CopyStats(CNodeStats& stats)
} else {
stats.fRelayTxes = false;
}
- X(nLastSend);
- X(nLastRecv);
+ X(m_last_send);
+ X(m_last_recv);
X(nLastTXTime);
X(nLastBlockTime);
X(nTimeConnected);
@@ -633,7 +633,7 @@ bool CNode::ReceiveMsgBytes(Span<const uint8_t> msg_bytes, bool& complete)
complete = false;
const auto time = GetTime<std::chrono::microseconds>();
LOCK(cs_vRecv);
- nLastRecv = std::chrono::duration_cast<std::chrono::seconds>(time).count();
+ m_last_recv = std::chrono::duration_cast<std::chrono::seconds>(time).count();
nRecvBytes += msg_bytes.size();
while (msg_bytes.size() > 0) {
// absorb network data
@@ -804,7 +804,7 @@ size_t CConnman::SocketSendData(CNode& node) const
nBytes = send(node.hSocket, reinterpret_cast<const char*>(data.data()) + node.nSendOffset, data.size() - node.nSendOffset, MSG_NOSIGNAL | MSG_DONTWAIT);
}
if (nBytes > 0) {
- node.nLastSend = GetTimeSeconds();
+ node.m_last_send = GetTimeSeconds();
node.nSendBytes += nBytes;
node.nSendOffset += nBytes;
nSentSize += nBytes;
@@ -1330,18 +1330,18 @@ bool CConnman::InactivityCheck(const CNode& node) const
if (!ShouldRunInactivityChecks(node, now)) return false;
- if (node.nLastRecv == 0 || node.nLastSend == 0) {
- LogPrint(BCLog::NET, "socket no message in first %i seconds, %d %d peer=%d\n", m_peer_connect_timeout, node.nLastRecv != 0, node.nLastSend != 0, node.GetId());
+ if (node.m_last_recv == 0 || node.m_last_send == 0) {
+ LogPrint(BCLog::NET, "socket no message in first %i seconds, %d %d peer=%d\n", m_peer_connect_timeout, node.m_last_recv != 0, node.m_last_send != 0, node.GetId());
return true;
}
- if (now > node.nLastSend + TIMEOUT_INTERVAL) {
- LogPrint(BCLog::NET, "socket sending timeout: %is peer=%d\n", now - node.nLastSend, node.GetId());
+ if (now > node.m_last_send + TIMEOUT_INTERVAL) {
+ LogPrint(BCLog::NET, "socket sending timeout: %is peer=%d\n", now - node.m_last_send, node.GetId());
return true;
}
- if (now > node.nLastRecv + TIMEOUT_INTERVAL) {
- LogPrint(BCLog::NET, "socket receive timeout: %is peer=%d\n", now - node.nLastRecv, node.GetId());
+ if (now > node.m_last_recv + TIMEOUT_INTERVAL) {
+ LogPrint(BCLog::NET, "socket receive timeout: %is peer=%d\n", now - node.m_last_recv, node.GetId());
return true;
}