MCPcopy Create free account
hub / github.com/ElementsProject/elements / prepareForTransport

Method prepareForTransport

src/net.cpp:825–836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

823}
824
825void V1TransportSerializer::prepareForTransport(CSerializedNetMsg& msg, std::vector<unsigned char>& header) {
826 // create dbl-sha256 checksum
827 uint256 hash = Hash(msg.data);
828
829 // create header
830 CMessageHeader hdr(Params().MessageStart(), msg.m_type.c_str(), msg.data.size());
831 memcpy(hdr.pchChecksum, hash.begin(), CMessageHeader::CHECKSUM_SIZE);
832
833 // serialize header
834 header.reserve(CMessageHeader::HEADER_SIZE);
835 CVectorWriter{SER_NETWORK, INIT_PROTO_VERSION, header, 0, hdr};
836}
837
838size_t CConnman::SocketSendData(CNode& node) const
839{

Callers 3

PushMessageMethod · 0.80
FUZZ_TARGET_INITFunction · 0.80
ReceiveMsgFromMethod · 0.80

Calls 5

HashFunction · 0.70
ParamsClass · 0.70
sizeMethod · 0.45
beginMethod · 0.45
reserveMethod · 0.45

Tested by 2

FUZZ_TARGET_INITFunction · 0.64
ReceiveMsgFromMethod · 0.64