aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-12-10 22:59:15 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-12-10 23:02:38 +0000
commit3a3370096e7564063d9d4f2c645090077f0f86f9 (patch)
tree8a30551381001a182c52306cb6ffef5e3fc1cac1
parentMerge pull request #7109 (diff)
downloadmonero-3a3370096e7564063d9d4f2c645090077f0f86f9.tar.xz
protocol: one more sanity check on usable data from a peer
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index c62a0cd31..31fb2b1b8 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -2522,7 +2522,7 @@ skip:
}
uint64_t n_use_blocks = m_core.prevalidate_block_hashes(arg.start_height, arg.m_block_ids, arg.m_block_weights);
- if (n_use_blocks + HASH_OF_HASHES_STEP <= arg.m_block_ids.size())
+ if (n_use_blocks == 0 || n_use_blocks + HASH_OF_HASHES_STEP <= arg.m_block_ids.size())
{
LOG_ERROR_CCONTEXT("Most blocks are invalid, dropping connection");
drop_connection(context, true, false);