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

Method SendV1Version

src/test/net_tests.cpp:1158–1164  ·  view source on GitHub ↗

Send V1 version message header to the transport. */

Source from the content-addressed store, hash-verified

1156
1157 /** Send V1 version message header to the transport. */
1158 void SendV1Version(const MessageStartChars& magic)
1159 {
1160 CMessageHeader hdr(magic, "version", 126 + m_rng.randrange(11));
1161 DataStream ser{};
1162 ser << hdr;
1163 m_to_send.insert(m_to_send.end(), UCharCast(ser.data()), UCharCast(ser.data() + ser.size()));
1164 }
1165
1166 /** Schedule bytes to be sent to the transport. */
1167 void Send(std::span<const std::byte> data) { Send(MakeUCharSpan(data)); }

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 6

UCharCastFunction · 0.85
randrangeMethod · 0.80
insertMethod · 0.45
endMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected