diff options
author | Alexander Blair <snipa@jagtech.io> | 2021-01-01 22:35:59 -0800 |
---|---|---|
committer | Alexander Blair <snipa@jagtech.io> | 2021-01-01 22:35:59 -0800 |
commit | 16c780d5688c7931ca6f55537c9cc8c1d4abc3dd (patch) | |
tree | 9efba2d35c48d1f6b592d54211b1bd52bfed0a36 /src/p2p | |
parent | Merge pull request #7246 (diff) | |
parent | Add aggressive restrictions to pre-handshake p2p buffer limit (diff) | |
download | monero-16c780d5688c7931ca6f55537c9cc8c1d4abc3dd.tar.xz |
Merge pull request #7250
61b6e4cc6 Add aggressive restrictions to pre-handshake p2p buffer limit (Lee Clagett)
Diffstat (limited to 'src/p2p')
-rw-r--r-- | src/p2p/net_node.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h index 9fba5d636..1f9fa46a4 100644 --- a/src/p2p/net_node.h +++ b/src/p2p/net_node.h @@ -118,6 +118,8 @@ namespace nodetool m_in_timedsync(false) {} + static constexpr int handshake_command() noexcept { return 1001; } + std::vector<cryptonote::blobdata> fluff_txs; std::chrono::steady_clock::time_point flush_time; peerid_type peer_id; @@ -139,6 +141,7 @@ namespace nodetool typedef COMMAND_HANDSHAKE_T<typename t_payload_net_handler::payload_type> COMMAND_HANDSHAKE; typedef COMMAND_TIMED_SYNC_T<typename t_payload_net_handler::payload_type> COMMAND_TIMED_SYNC; + static_assert(p2p_connection_context::handshake_command() == COMMAND_HANDSHAKE::ID, "invalid handshake command id"); typedef epee::net_utils::boosted_tcp_server<epee::levin::async_protocol_handler<p2p_connection_context>> net_server; |