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

Method StartSendingHandshake

src/net.cpp:994–1004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

992} // namespace
993
994void V2Transport::StartSendingHandshake() noexcept
995{
996 AssertLockHeld(m_send_mutex);
997 Assume(m_send_state == SendState::AWAITING_KEY);
998 Assume(m_send_buffer.empty());
999 // Initialize the send buffer with ellswift pubkey + provided garbage.
1000 m_send_buffer.resize(EllSwiftPubKey::size() + m_send_garbage.size());
1001 std::copy(std::begin(m_cipher.GetOurPubKey()), std::end(m_cipher.GetOurPubKey()), MakeWritableByteSpan(m_send_buffer).begin());
1002 std::copy(m_send_garbage.begin(), m_send_garbage.end(), m_send_buffer.begin() + EllSwiftPubKey::size());
1003 // We cannot wipe m_send_garbage as it will still be used as AAD later in the handshake.
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},

Callers

nothing calls this directly

Calls 9

sizeFunction · 0.85
beginFunction · 0.85
endFunction · 0.85
MakeWritableByteSpanFunction · 0.85
emptyMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected