aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-06-03 18:41:36 +0200
committerRiccardo Spagni <ric@spagni.net>2018-06-03 18:41:36 +0200
commite2c39f6b59fcf5c623c814dfefc518ab0b7eca32 (patch)
tree81d0ae9fd1e48eaa03ba5b557e88e3d36fd8ca67
parentMerge pull request #3912 (diff)
parentprotocol: drop (and increase fails) if most blocks hashes are invalid (diff)
downloadmonero-0.12.2.0.tar.xz
Merge pull request #3914v0.12.2.0
107eec4d protocol: drop (and increase fails) if most blocks hashes are invalid (moneromooo-monero)
Diffstat (limited to '')
-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;
}