aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-06-02 21:32:42 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-06-03 17:37:06 +0100
commit107eec4dca5a0d8be24fbece12fdbc060629c50a (patch)
tree0e75d1afda3a15c7583843d36646d2bff1f1d2c5 /src
parentMerge pull request #3858 (diff)
downloadmonero-107eec4dca5a0d8be24fbece12fdbc060629c50a.tar.xz
protocol: drop (and increase fails) if most blocks hashes are invalid
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl6
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 91c6c5d5e..2e1df8078 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -1630,10 +1630,10 @@ skip:
}
uint64_t n_use_blocks = m_core.prevalidate_block_hashes(arg.start_height, arg.m_block_ids);
- if (n_use_blocks == 0)
+ if (n_use_blocks + HASH_OF_HASHES_STEP <= arg.m_block_ids.size())
{
- LOG_ERROR_CCONTEXT("Peer yielded no usable blocks, dropping connection");
- drop_connection(context, false, false);
+ LOG_ERROR_CCONTEXT("Most blocks are invalid, dropping connection");
+ drop_connection(context, true, false);
return 1;
}