Merge pull request #3910

f2cb56a protocol: drop (and increase fails) if most blocks hashes are invalid (moneromooo-monero)
This commit is contained in:
luigi1111 2018-06-07 12:24:02 -05:00
commit 03b4cca6c2
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -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;
}