Skip to content

Commit

Permalink
Merge pull request #3914
Browse files Browse the repository at this point in the history
107eec4 protocol: drop (and increase fails) if most blocks hashes are invalid (moneromooo-monero)
  • Loading branch information
fluffypony committed Jun 3, 2018
2 parents f12b277 + 107eec4 commit e2c39f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cryptonote_protocol/cryptonote_protocol_handler.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e2c39f6

Please sign in to comment.