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

Method V2Transport

src/net.cpp:1006–1021  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1004}
1005
1006V2Transport::V2Transport(NodeId nodeid, bool initiating, const CKey& key, std::span<const std::byte> ent32, std::vector<uint8_t> garbage) noexcept
1007 : m_cipher{key, ent32},
1008 m_initiating{initiating},
1009 m_nodeid{nodeid},
1010 m_v1_fallback{nodeid},
1011 m_recv_state{initiating ? RecvState::KEY : RecvState::KEY_MAYBE_V1},
1012 m_send_garbage{std::move(garbage)},
1013 m_send_state{initiating ? SendState::AWAITING_KEY : SendState::MAYBE_V1}
1014{
1015 Assume(m_send_garbage.size() <= MAX_GARBAGE_LEN);
1016 // Start sending immediately if we're the initiator of the connection.
1017 if (initiating) {
1018 LOCK(m_send_mutex);
1019 StartSendingHandshake();
1020 }
1021}
1022
1023V2Transport::V2Transport(NodeId nodeid, bool initiating) noexcept
1024 : V2Transport{nodeid, initiating, GenerateRandomKey(),

Callers

nothing calls this directly

Calls 5

GenerateRandomKeyFunction · 0.85
MakeByteSpanFunction · 0.85
GetRandHashFunction · 0.85
GenerateRandomGarbageFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected