From ca8d4a38c969a924c7b83ceaaa05e1125ce60014 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Fri, 16 Aug 2019 21:11:41 -0300 Subject: [PATCH] Fix check for disconnecting peers when syncing 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. --- src/cryptonote_protocol/cryptonote_protocol_handler.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index 03d04a074..bbf2020d4 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -341,7 +341,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;