aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/cryptonote_protocol_handler.inl
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-11-03 12:59:36 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-11-03 12:59:36 +0000
commitf9527e608ef48b4a71d5a6f4925f51098637768e (patch)
treeb21d86e59ee45952f952a637056c0e8eafd851ad /src/cryptonote_protocol/cryptonote_protocol_handler.inl
parent8b3b106ad1bc32b81a3ef74e789844d9f671f709 (diff)
downloadmonzero-core-f9527e608ef48b4a71d5a6f4925f51098637768e.tar.gz
monzero-core-f9527e608ef48b4a71d5a6f4925f51098637768e.tar.xz
monzero-core-f9527e608ef48b4a71d5a6f4925f51098637768e.zip
protocol: reject empty incoming block messages
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_handler.inl')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index a8073e091..20bcd7f3b 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -1091,6 +1091,13 @@ namespace cryptonote
//epee::net_utils::network_throttle_manager::get_global_throttle_inreq().logger_handle_net("log/dr-monero/net/req-all.data", sec, get_avg_block_size());
+ if(arg.blocks.empty())
+ {
+ LOG_ERROR_CCONTEXT("sent wrong NOTIFY_HAVE_OBJECTS: no blocks");
+ drop_connection(context, true, false);
+ ++m_sync_bad_spans_downloaded;
+ return 1;
+ }
if(context.m_last_response_height > arg.current_blockchain_height)
{
LOG_ERROR_CCONTEXT("sent wrong NOTIFY_HAVE_OBJECTS: arg.m_current_blockchain_height=" << arg.current_blockchain_height