Skip to content

Commit

Permalink
Fix check for disconnecting peers when syncing
Browse files Browse the repository at this point in the history
The check added here (in #5732/#5733) is supposed to disconnect behind
peers when the current node is syncing, but actually disconnects behind
peers always.

We are syncing when `target > our_height`, but the check here triggers
when `target > remote_height`, which is basically always true when the
preceding `m_core.have_block(hshd.top_id)` check is true.
  • Loading branch information
jagerman committed Aug 17, 2019
1 parent 310c268 commit adc16d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cryptonote_protocol/cryptonote_protocol_handler.inl
Expand Up @@ -342,7 +342,7 @@ namespace cryptonote

if(m_core.have_block(hshd.top_id))
{
if (target > hshd.current_height)
if (target > m_core.get_current_blockchain_height())
{
MINFO(context << "peer is not ahead of us and we're syncing, disconnecting");
return false;
Expand Down

0 comments on commit adc16d2

Please sign in to comment.