diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-03-08 19:17:20 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-06-14 08:47:08 +0000 |
commit | 1cc61018e52893382ae110430b38d1e0bf6e5870 (patch) | |
tree | 2f5663ddb7a315acb9e4239b3d3eaf7c641563dd /src/cryptonote_protocol/cryptonote_protocol_handler.inl | |
parent | cryptonote_protocol_handler: prevent potential DoS (diff) | |
download | monero-1cc61018e52893382ae110430b38d1e0bf6e5870.tar.xz |
cryptonote_protocol: expand basic DoS protection
Count transactions as well
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_handler.inl')
-rw-r--r-- | src/cryptonote_protocol/cryptonote_protocol_handler.inl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index 0eacc7cd4..78acb3179 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -915,12 +915,12 @@ namespace cryptonote { MLOG_P2P_MESSAGE("Received NOTIFY_REQUEST_GET_OBJECTS (" << arg.blocks.size() << " blocks, " << arg.txs.size() << " txes)"); - if (arg.blocks.size() > CURRENCY_PROTOCOL_MAX_BLOCKS_REQUEST_COUNT) + if (arg.blocks.size() + arg.txs.size() > CURRENCY_PROTOCOL_MAX_OBJECT_REQUEST_COUNT) { LOG_ERROR_CCONTEXT( "Requested objects count is too big (" - << arg.blocks.size() << ") expected not more then " - << CURRENCY_PROTOCOL_MAX_BLOCKS_REQUEST_COUNT); + << arg.blocks.size() + arg.txs.size() << ") expected not more then " + << CURRENCY_PROTOCOL_MAX_OBJECT_REQUEST_COUNT); drop_connection(context, false, false); return 1; } |