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

Method GetBytesToSend

src/net.cpp:873–892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

871}
872
873Transport::BytesToSend V1Transport::GetBytesToSend(bool have_next_message) const noexcept
874{
875 AssertLockNotHeld(m_send_mutex);
876 LOCK(m_send_mutex);
877 if (m_sending_header) {
878 return {std::span{m_header_to_send}.subspan(m_bytes_sent),
879 // We have more to send after the header if the message has payload, or if there
880 // is a next message after that.
881 have_next_message || !m_message_to_send.data.empty(),
882 m_message_to_send.m_type
883 };
884 } else {
885 return {std::span{m_message_to_send.data}.subspan(m_bytes_sent),
886 // We only have more to send after this message's payload if there is another
887 // message.
888 have_next_message,
889 m_message_to_send.m_type
890 };
891 }
892}
893
894void V1Transport::MarkBytesSent(size_t bytes_sent) noexcept
895{

Callers 10

SocketSendDataMethod · 0.80
GenerateWaitSocketsMethod · 0.80
PushMessageMethod · 0.80
InteractMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
SimulationTestFunction · 0.80
FlushSendBufferMethod · 0.80
ReceiveMsgFromMethod · 0.80
PushNetMsgMethod · 0.80

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by 6

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