MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / MarkBytesSent

Method MarkBytesSent

src/net.cpp:894–908  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

892}
893
894void V1Transport::MarkBytesSent(size_t bytes_sent) noexcept
895{
896 AssertLockNotHeld(m_send_mutex);
897 LOCK(m_send_mutex);
898 m_bytes_sent += bytes_sent;
899 if (m_sending_header && m_bytes_sent == m_header_to_send.size()) {
900 // We're done sending a message's header. Switch to sending its data bytes.
901 m_sending_header = false;
902 m_bytes_sent = 0;
903 } else if (!m_sending_header && m_bytes_sent == m_message_to_send.data.size()) {
904 // We're done sending a message's data. Wipe the data vector to reduce memory consumption.
905 ClearShrink(m_message_to_send.data);
906 m_bytes_sent = 0;
907 }
908}
909
910size_t V1Transport::GetSendMemoryUsage() const noexcept
911{

Callers 7

SocketSendDataMethod · 0.80
InteractMethod · 0.80
SimulationTestFunction · 0.80
FlushSendBufferMethod · 0.80
ReceiveMsgFromMethod · 0.80
PushNetMsgMethod · 0.80

Calls 2

ClearShrinkFunction · 0.85
sizeMethod · 0.45

Tested by 5

InteractMethod · 0.64
SimulationTestFunction · 0.64
FlushSendBufferMethod · 0.64
ReceiveMsgFromMethod · 0.64
PushNetMsgMethod · 0.64