| 1004 | } |
| 1005 | |
| 1006 | V2Transport::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 | |
| 1023 | V2Transport::V2Transport(NodeId nodeid, bool initiating) noexcept |
| 1024 | : V2Transport{nodeid, initiating, GenerateRandomKey(), |
nothing calls this directly
no test coverage detected