protocol: drop (and increase fails) if most blocks hashes are invalid

This commit is contained in:
moneromooo-monero 2018-06-02 21:32:42 +01:00 committed by wowario
parent 80cb158b4b
commit 6995c9bf75
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111
1 changed files with 3 additions and 3 deletions

View File

@ -1632,10 +1632,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;
}