diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-03 13:05:10 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-03 13:05:10 +0000 |
commit | b927f0b17edb419cf4ab16b31e68c93a238e8739 (patch) | |
tree | 0a98ce1220b84fb091e6d2388c40c290183bbc10 /src | |
parent | Merge pull request #2845 (diff) | |
download | monero-b927f0b17edb419cf4ab16b31e68c93a238e8739.tar.xz |
cryptonote_protocol: fix corner case looping asking for same block hashes
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptonote_protocol/cryptonote_protocol_handler.inl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index 9ae24551c..48ab1eadf 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -1414,6 +1414,10 @@ skip: // take out blocks we already have while (!context.m_needed_objects.empty() && m_core.have_block(context.m_needed_objects.front())) { + // if we're popping the last hash, record it so we can ask again from that hash, + // this prevents never being able to progress on peers we get old hash lists from + if (context.m_needed_objects.size() == 1) + context.m_last_known_hash = context.m_needed_objects.front(); context.m_needed_objects.pop_front(); } const uint64_t first_block_height = context.m_last_response_height - context.m_needed_objects.size() + 1; |