aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/cryptonote_protocol_handler.inl
diff options
context:
space:
mode:
authorJason Rhinelander <jason@imaginary.ca>2019-08-16 21:11:41 -0300
committerJason Rhinelander <jason@imaginary.ca>2019-08-16 21:16:33 -0300
commitadc16d2504d3e76b0115791caf10446684d45433 (patch)
tree7cd6e661a73d6f4eebc6094630f50633f2943798 /src/cryptonote_protocol/cryptonote_protocol_handler.inl
parentMerge pull request #5756 (diff)
downloadmonero-adc16d2504d3e76b0115791caf10446684d45433.tar.xz
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.
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_handler.inl')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index a1fa9484c..2ff7b5938 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -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;