mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-18 08:32:30 +01:00
[net] Move RecordBytesSent() call out of cs_vSend lock
This commit is contained in:
14
src/net.cpp
14
src/net.cpp
@@ -1512,16 +1512,10 @@ void CConnman::SocketHandler()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
if (sendSet) {
|
||||||
// Send
|
// Send data
|
||||||
//
|
size_t bytes_sent = WITH_LOCK(pnode->cs_vSend, return SocketSendData(pnode));
|
||||||
if (sendSet)
|
if (bytes_sent) RecordBytesSent(bytes_sent);
|
||||||
{
|
|
||||||
LOCK(pnode->cs_vSend);
|
|
||||||
size_t nBytes = SocketSendData(pnode);
|
|
||||||
if (nBytes) {
|
|
||||||
RecordBytesSent(nBytes);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InactivityCheck(pnode);
|
InactivityCheck(pnode);
|
||||||
|
|||||||
Reference in New Issue
Block a user